How To Upgrade Powershell Version In Windows Server 2012 R2
If you have virtual automobile (VM) instances running before versions of Windows Server, you can upgrade them to afterwards versions of Windows Server:
Upgrade from | Upgrade to |
---|---|
Windows Server 2008 R2 (Desktop Experience) | Windows Server 2012 R2 (Desktop Feel) |
Windows Server 2012 R2 (Cadre) | Windows Server 2016 (Cadre) |
Windows Server 2012 R2 (Core) | Windows Server 2019 (Core) |
Windows Server 2012 R2 (Desktop Feel) | Windows Server 2016 (Desktop Feel) |
Windows Server 2012 R2 (Desktop Experience) | Windows Server 2019 (Desktop Experience) |
Windows Server 2016 (Core) | Windows Server 2019 (Core) |
Windows Server 2016 (Desktop Experience) | Windows Server 2019 (Desktop Feel) |
Upgrades are subject area to the following constraints:
- If y'all programme to upgrade Windows Server 2008 R2 to a version later than Windows Server 2012 R2, y'all must commencement perform an upgrade to Windows Server 2012 R2, and then perform a second upgrade to Windows Server 2016 or Windows Server 2019.
This guide describes how to perform a manual in-identify upgrade of Windows Server. For upgrades from Windows Server 2008 R2 to Windows Server 2012 R2, you can also perform automated in-place upgrades by using the Google Deject CLI.
Objectives
This guide describes how to perform an in-place upgrade of Windows Server by:
- Planning the in-place upgrade
- Performing the in-place upgrade
- Troubleshooting the in-place upgrade
- Cleaning up after the in-identify upgrade
Costs
There is no charge for performing an in-place upgrade of Windows Server. You lot are only charged for the resources consumed during the upgrade, including:
- Compute Engine
Use the pricing calculator to generate a cost approximate based on your projected usage.
Before you begin
The guide assumes that yous take basic noesis of:
- Compute Engine
- Performing unattended Windows Server installations by using Windows Setup.
Program the in-place upgrade
Performing an in-place upgrade of a virtual automobile (VM) instance that is running an earlier version of Windows Server tin can be a pragmatic way to modernize your infrastructure and to mitigate the risks of budgeted the end of the support lifecycle of Windows Server versions.
Alternatives to consider
Before you determine to apply an in-place upgrade to migrate to a newer version of Windows Server, exist enlightened of the following limitations:
-
Downtime: Depending on the configuration and software installed, the upgrade might take an hour or longer. During the upgrade, access to the VM instance is limited because:
- Workloads running on the VM case are unavailable to users
- Remote Desktop Protocol (RDP) is not available
- There are express means to check the upgrade progress and the time remaining in the upgrade
-
Risk: Depending on the configurations of your existing instances and the installed software:
- The upgrade tin fail
- Some configuration options can be overridden
- Incompatibilities can cause your workload to malfunction on the upgraded instance
Depending on the workload running on your Windows Server instance, you tin can reduce reanimation and hazard past pursuing different approaches.
Workload | Approach |
---|---|
Your VM instance is running a workload that supports replication, such as:
| Consider setting up a new VM example that is running a more recent version of Windows Server, and then apply replication to shift the workload from your existing VM case to the new VM example. |
You have a VM instance that is running a multitude of workloads | Consider migrating these workloads to split up VM instances and so that each VM instance runs only a single workload. Even if you can't migrate all workloads, reducing the number of workloads running on a single VM instance can help reduce risks during an in-identify upgrade. |
Production keys
A Windows Server production central is valid for but a specific version; when you lot perform an upgrade to a later version of Windows Server, yous must supply a new production key. There are 2 master scenarios:
-
You are upgrading a VM case that is based on a public operating organisation epitome provided by Google: In this scenario, you must use the predefined KMS customer setup keys for the version of Windows Server that y'all are upgrading to. The upgrade does not incur boosted charges.
-
You are upgrading a VM instance for which you brought an existing license: In BYOL, you need to larn a product key from your license vendor to perform the upgrade. Check the Microsoft documentation to determine which edition y'all can upgrade to and whether you lot are eligible for license conversion.
Installation media
To perform the upgrade, you demand an installation media. There are two main scenarios:
-
You are upgrading a VM instance that is based on a public operating organization image provided past Google: In this scenario, you can use the volume license installation media provided past Google. The steps to admission this installation media are provided below.
-
You lot are upgrading a VM instance that is based on an imported disk or image: In this scenario, you cannot use the installation media provided past Google. Instead, you lot take to use an installation media that matches the type of media that you lot used to install Windows Server on the imported disk or prototype.
Other prerequisites
Before you begin your upgrade, review the Microsoft documentation near prerequisites and potential limitations for the version of Windows Server you are planning to upgrade to:
Perform the in-place upgrade
The post-obit sections guide you through the procedure of upgrading your VM instance.
Create a snapshot
Before you showtime the upgrade, we recommend that you lot create a snapshot of your VM instance, so that you tin can revert to a safe state in case anything goes wrong:
-
Create a regular snapshot for the kicking deejay of your VM case.
-
If the VM instance has boosted information disks fastened, create snapshots for the data disks by using the Volume Shadow Copy Service (VSS).
Prepare your Windows Server configuration
Verify the configuration of your Windows Server VM instance:
-
Connect to your VM case with an RDP client.
-
Verify that Windows Server is up to appointment by using Windows Update.
-
Disable or uninstall antivirus, antispyware, and other agents that can interfere with the upgrade or are incompatible with the Windows Server version that you're upgrading to.
Attach the install media
Before you can perform the upgrade, adhere the necessary installation media to the VM instance. The right media to use depends on your scenario:
- You are upgrading a VM example that is based on a public operating arrangement image provided by Google: In this scenario, you lot simply need to attach the volume license installation media provided by Google. This media contains both the necessary scripts to run the upgrade and the files for the new version of Windows Server.
-
You are upgrading a VM instance that is based on an imported disk or image: In this scenario, you also need to attach the volume license installation media provided by Google so that yous tin access the necessary scripts.
Additionally, y'all have to attach a custom installation media that matches the type of media that yous used to install Windows Server on the imported deejay or prototype.
To attach the volume license installation media provided by Google, follow these steps:
-
In the Google Cloud Console, open Cloud Shell by clicking the Actuate Deject Beat out push button.
Go to the Google Deject Console
-
Gear up the default projection ID. Supervene upon
PROJECT_ID
with the name of your Compute Engine project:gcloud config set projection PROJECT_ID
-
Create a disk based on the installation media. Replace
ZONE
with the name of the zone where the VM example is located:gcloud compute disks create win-installers --image-family=windows-install-media --image-project=compute-paradigm-tools --zone=ZONE
This command adds a disk named
win-installers
to your projection. This deejay is not fastened to any VM instance. -
Attach the disk to your VM case past using read-just (
ro
) fashion, then that you can attach the disk to multiple VM instances if necessary:gcloud compute instances attach-disk VM_NAME --disk=win-installers --mode=ro --zone=ZONE
Supervene upon the post-obit:
-
VM_NAME
: the name of the VM example to upgrade -
ZONE
: the name of the zone where the VM instance is located
-
If you are upgrading a VM case that is based on an imported disk or epitome, adhere the custom installation media every bit an additional disk:
-
Follow the steps in Creating an image from an ISO file to create a disk from the ISO image that you want to use as custom installation media.
-
Attach the deejay to your VM example, by using read-only (
ro
) mode and so that yous can attach the disk to multiple VM instances if necessary:gcloud compute instances attach-disk VM_NAME --disk=CUSTOM_MEDIA_DISK --mode=ro --zone=ZONE
Replace the following:
-
VM_NAME
: the proper name of the VM instance to upgrade -
CUSTOM_MEDIA_DISK
: the name of the disk containing your custom installation media -
ZONE
: the proper noun of the zone where the VM example is located
-
Start the upgrade
By default, Windows Setup prompts you for input at various points during an upgrade. Because y'all can't connect to the VM instance by using RDP during the upgrade and therefore tin can't provide whatsoever input, run the upgrade in unattended manner.
-
Connect to your VM example with an RDP customer. For more data, see Connecting to instances.
-
Open up an elevated command prompt:
- If you use Server Core, an elevated control prompt should open automatically afterwards login.
- If you utilise Windows Server with full Desktop Experience, right-click the Start button and select Control Prompt (Admin).
-
Change the working directory to the installation media. The correct working directory depends on the Windows Server version that you are upgrading to:
2012 R2
cd /d d:\*2012*
2016
cd /d d:\*2016*
2019
cd /d d:\*2019*
-
Start the Windows upgrade. The required steps to start the upgrade depend on the Windows Server version that you are upgrading to and whether your VM case is based on a public operating arrangement image or on an imported deejay or image:
2012 R2
Run
upgrade.ps1
to kickoff the Windows upgrade. The script completes the following steps:- Install the latest Google driver packages, which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required for Compute Engine.
- Enable access to the Emergency Management Services (Ems) console during the upgrade.
- Launch Windows Setup (
setup.exe
) from the install media to perform an upgrade in unattended mode. - Select the correct edition of Windows Server 2012 R2 to install.
- Provide a production key for the new version of Windows Server.
powershell -ExecutionPolicy Bypass -File upgrade.ps1
2012 R2 (imported)
Run
upgrade.ps1
to offset the Windows upgrade. The script completes the following steps:- Install the latest Google commuter packages, which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required for Compute Engine.
- Enable access to the Emergency Management Services (European monetary system) console during the upgrade.
- Launch Windows Setup (
setup.exe
) from the install media to perform an upgrade in unattended mode. - Select the correct edition of Windows Server 2012 R2 to install.
powershell -ExecutionPolicy Bypass -File upgrade.ps1 -SetupExePath SETUP_PATH -Unattend UNATTEND_PATH
Replace the following:
-
SETUP_PATH
: the path tosetup.exe
on your custom installation media -
UNATTEND_PATH
: the path to a customunattend.xml
file that contains a valid production key
The
-Unattend
parameter is only required if you lot are upgrading a VM example for which you brought an existing license (BYOL)2016 or 2019
Run
upgrade.ps1
to starting time the Windows upgrade. The script completes the following steps:- Install the latest Google driver packages, which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required for Compute Engine.
- Enable access to the Emergency Management Services (EMS) console during the upgrade.
- Launch Windows Setup (
setup.exe
) from the install media to perform an upgrade in silent mode. - Provide a product central for the new version of Windows Server.
powershell -ExecutionPolicy Bypass -File upgrade.ps1
On the Select Prototype screen, select the configuration that matches your current configuration:
- If you lot currently utilize Server Cadre, select Windows Server Datacenter.
-
If you currently utilise Windows Server with full desktop experience, select Windows Server Datacenter (Desktop Feel).
-
Click Next to begin the upgrade.
It might take several minutes for the setup to initialize.
2016 or 2019 (imported)
Run
upgrade.ps1
to start the Windows upgrade. The script completes the following steps:- Install the latest Google driver packages, which are disquisitional for the Windows Server upgrade to succeed.
- Apply Windows settings that are required for Compute Engine.
- Enable access to the Emergency Management Services (Ems) console during the upgrade.
- Launch Windows Setup (
setup.exe
) from the install media to perform an upgrade in silent mode.
powershell -ExecutionPolicy Featherbed -File upgrade.ps1 -SetupExePath SETUP-PATH -ProductKey PRODUCT-KEY
Supplant the following:
-
SETUP_PATH
: the path tosetup.exe
on your custom installation media -
PRODUCT_KEY
: a valid product key for Windows Server 2016
The
-ProductKey
parameter is but required if you are upgrading a VM instance for which you brought an existing license (BYOL).On the Select Image screen, select the configuration that matches your current configuration:
- If y'all currently use Server Core, select Windows Server 2016 Datacenter.
-
If y'all currently use Windows Server with total desktop experience, select Windows Server 2016 Datacenter (Desktop Experience).
-
Click Side by side to begin the upgrade.
It might take several minutes for the setup to initialize.
The upgrade process might issue the post-obit warning. If so, y'all can ignore it:
[parcel name] or a newer version is already installed on the system
Afterwards about 5 minutes, the machine reboots, and RDP disconnects.
Discover the upgrade procedure
Depending on the machine type of your VM instance and your Windows Server configuration, the upgrade might take between 10 and sixty minutes to complete. During that time, you can observe the status through the serial port output:
-
In Cloud Shell, observe the boot process by running the following command:
gcloud compute instances tail-series-port-output VM_NAME --zone=ZONE
Supersede the following:
-
VM_NAME
: name of your VM instance -
ZONE
: name of the zone where the VM case is located
-
-
Wait until the machine has rebooted four times. Depending on the configuration of your VM example, it might accept xxx minutes or more for these reboots to occur. You can recognize a reboot by output that looks like to this:
SeaBIOS (version 1.eight.two-20190620_103534-google) Full RAM Size = 0x00000001e0000000 = 7680 MiB CPUs institute: two Max CPUs supported: 2
-
Later on the fourth reboot, wait until the output
GCEMetadataScripts: Finished running startup scripts
orNo startup scripts to run
appears.
Perform post-upgrade steps
Y'all can now connect to the VM instance to verify that the upgrade has been successfully completed.
-
Connect to the VM example by using an RDP client. For more information, run across Connecting to instances.
-
Log in using a user account with local administrator privileges.
-
Open up an elevated command prompt:
- If yous use Server Cadre, an elevated command prompt should open up automatically after login.
- If you utilize Windows Server with full desktop experience, right-click the Commencement push and select Command Prompt (Admin).
-
Run the following command to query the version of Windows Server:
Windows Server Core
ver
Windows Server with Desktop Experience
winver
Verify that the version matches the expected version of Windows Server.
-
Change the working directory to the installation media. The correct working directory depends on the Windows Server version that y'all are upgrading to:
2012 R2
cd /d d:\*2012*
2016
cd /d d:\*2016*
2019
cd /d d:\*2019*
-
Run
upgrade.ps1
again to re-apply specific Compute Engine settings that might have been lost during the upgrade:powershell -ExecutionPolicy Bypass -File upgrade.ps1
-
Restart the VM instance to ensure all changes take consequence. It might take one to 2 minutes for the reboot to consummate before yous can connect to the VM instance once more.
Detach the installation disk
You can now detach the installation disk from the VM case:
-
In Cloud Crush, detach the installation disk from your VM example, replacing
VM_NAME
with the proper name of your VM example:gcloud compute instances disassemble-disk VM_NAME --disk=win-installers
Install updates and restore access
After the upgrade is complete, run Windows Update to download and install any security updates. To install the security updates, follow these steps:-
Connect to the machine by using an RDP client. For more information, see Connecting to instances.
-
Use Windows Update to install the latest Windows updates. You lot might accept to restart the VM instance multiple times during this process.
-
Re-enable whatever agents, antivirus, or antimalware software that you disabled before the upgrade.
Troubleshoot the in-place upgrade
While running Windows Setup, you lot can't connect to the VM instance with RDP. If you suspect that the upgrade failed or is non progressing, use the following approaches, in social club, to diagnose the situation:
Check the series port output
To check the progress of the upgrade procedure, view the serial port output of the VM example:
- Serial port 1 captures the boot status
- Series port 3 captures the log output of Windows Setup
During the upgrade, y'all should observe four reboots. If yous don't find any progress for more than than xxx minutes after the first reboot, it is likely that the upgrade failed.
Check CPU and I/O metrics
Running a Windows Server upgrade is a CPU and deejay I/O intensive operation. Past checking the CPU and I/O metrics, y'all tin can become an indication for whether the setup is progressing.
View the CPU and I/O metrics in the Google Deject Console:
-
In the Deject Console, go to the VM instances page.
Go to VM instances
-
Click the instance that you're upgrading.
-
Click the Monitoring tab.
Connect to the Emergency Direction Services console
Both during and after running Windows Setup, you can connect to the Emergency Management Services (EMS) console. Using the EMS console, check the Windows Setup log files and the outcome log for indications that the upgrade is still progressing or for information about any errors that might have occurred.
Connect remotely by using WinRM
If connecting by using RDP or EMS fails, you tin can attempt using WinRM to constitute a remote PowerShell session:
-
Connect to a different Windows Server instance in the same VPC.
-
Open up PowerShell.
-
Establish a remote PowerShell session, replacing
VM_NAME
with the proper name of the example to upgrade:Enter-PSSession -ComputerName VM_NAME -UseSSL -SessionOption (New-PsSessionOption -SkipCACheck) -Credential (Become-Credential)
-
When prompted for credentials, enter the username and password of an administrative user account.
-
Use the remote PowerShell session to check the Windows Setup log files and the event log.
Analyze log files offline
If you can't connect to the case past using Windows Remote Direction (WinRM), you can cancel the upgrade and analyze the log files from a different VM case. To practice this, follow these steps:
-
End the VM instance.
This can take several minutes if Windows Server is unresponsive.
-
Detach the boot disk from the case.
-
Create a new, temporary Windows Server instance, and attach the boot disk of the original instance as an boosted disk.
-
Use the temporary Windows Server example to analyze the setup log and result log files of the example that you lot were trying to upgrade.
-
Afterward you accept completed the assay, disassemble the disk from the temporary instance and reattach information technology as a kick deejay to the original VM instance.
Troubleshoot RDP
For information about troubleshooting RDP, encounter Troubleshooting RDP.
Troubleshoot your Windows Server instances
For information virtually troubleshooting your Windows Server instances, see Tips and troubleshooting for Windows instances.
Clean upwards
To avoid incurring further costs after you have completed this procedure, delete the installation disk.
Delete the installation deejay
Y'all can create an installation disk based on the Google-provided image at any fourth dimension. If you don't plan to upgrade more VM instances in the aforementioned zone, delete the installation deejay:
-
In Cloud Vanquish, delete the
win-installers
disk that y'all created earlier:gcloud compute disks delete win-installers
What's next
-
Learn how to bring existing licenses to Compute Engine.
-
Learn how to connect to Windows instances.
-
Acquire almost sole-tenant nodes on Compute Engine.
-
Work through more Windows tutorials.
Source: https://cloud.google.com/compute/docs/tutorials/performing-in-place-upgrade-windows-server
Posted by: evansfrod2002.blogspot.com
0 Response to "How To Upgrade Powershell Version In Windows Server 2012 R2"
Post a Comment