Skip to content

Commit a28bd69

Browse files
authored
Merge pull request #224335 from cynthn/updates-for-in-place-upgrade
New PR for updates to in-place-upgrades
2 parents df40107 + a3f877f commit a28bd69

File tree

1 file changed

+44
-38
lines changed

1 file changed

+44
-38
lines changed

articles/virtual-machines/windows-in-place-upgrade.md

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,34 @@ description: This article describes how to do an in-place upgrade for VMs runnin
44
services: virtual-machines
55
author: cynthn
66
ms.topic: how-to
7-
ms.date: 01/17/2023
7+
ms.date: 01/19/2023
88
ms.author: cynthn
99

1010
---
1111

1212
# In-place upgrade for VMs running Windows Server in Azure
1313

14-
An in-place upgrade allows you to go from an older operating system to a newer one while keeping your settings, server roles, and data intact. This article will teach you how to move your Azure VMs to a later version of Windows Server using an in-place upgrade.
14+
An in-place upgrade allows you to go from an older operating system to a newer one while keeping your settings, server roles, and data intact. This article will teach you how to move your Azure VMs to a later version of Windows Server using an in-place upgrade. Currently, upgrading to Windows Server 2019 and Windows Server 2022 is supported.
1515

1616
Before you begin an in-place upgrade:
1717

1818
- Review the upgrade requirements for the target operating system:
1919

20-
- Upgrade options for Windows Server 2019
20+
- Upgrade options for Windows Server 2019 from Windows Server 2012 R2 or Windows Server 2016
2121

22-
- Upgrade options for Windows Server 2022
22+
- Upgrade options for Windows Server 2022 from Windows Server 2016 or Windows Server 2019
2323

2424
- Verify the operating system disk has enough [free space to perform the in-place upgrade](/windows-server/get-started/hardware-requirements#storage-controller-and-disk-space-requirements). If additional space is needed [follow these steps](/azure/virtual-machines/windows/expand-os-disk) to expand the operating system disk attached to the VM.
2525

2626
- Disable antivirus and anti-spyware software and firewalls. These types of software can conflict with the upgrade process. Re-enable antivirus and anti-spyware software and firewalls after the upgrade is completed.
2727

28-
## Windows versions not yet supported for in-place system upgrades
29-
For the following versions, consider using the work-around in the next section:
28+
## Windows versions not yet supported for in-place upgrade
29+
For the following versions, consider using the [workaround](#workaround) later in this article:
3030

3131
- Windows Server 2012 Datacenter
3232
- Windows Server 2012 Standard
3333
- Windows Server 2008 R2 Datacenter
3434
- Windows Server 2008 R2 Standard
35-
### Work-around
36-
To work around this issue, create an Azure VM that's running a supported version. And then either migrate the workload (Method 1, preferred), or download and upgrade the VHD of the VM (Method 2).
37-
To prevent data loss, back up the Windows 10 VM by using [Azure Backup](../backup/backup-overview.md). Or use a third-party backup solution from [Azure Marketplace Backup & Recovery](https://azuremarketplace.microsoft.com/marketplace/apps?page=1&search=Backup+&exp=ubp8).
38-
#### Method 1: Deploy a newer system and migrate the workload
39-
40-
Create an Azure VM that runs a supported version of the operating system, and then migrate the workload. To do so, you'll use Windows Server migration tools. For instructions to migrate Windows Server roles and features, see [Install, use, and remove Windows Server migration tools](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012).
41-
42-
43-
#### Method 2: Download and upgrade the VHD
44-
1. Do an in-place upgrade in a local Hyper-V VM
45-
1. [Download the VHD](./windows/download-vhd.md) of the VM.
46-
2. Attach the VHD to a local Hyper-V VM.
47-
3. Start the VM.
48-
4. Run the in-place upgrade.
49-
2. Upload the VHD to Azure. For more information, see [Upload a generalized VHD and use it to create new VMs in Azure](./windows/upload-generalized-managed.md).
50-
5135

5236
## Upgrade VM to volume license (KMS server activation)
5337

@@ -68,7 +52,7 @@ We recommend that you create a snapshot of your operating system disk and any da
6852

6953
## Create upgrade media disk
7054

71-
To perform an in-place upgrade the upgrade media must be attached to the VM as a Managed Disk. To create the upgrade media, use the following PowerShell script with the specific variables configured for the desired upgrade media. The created upgrade media disk can be used to upgrade multiple VMs, but it can only be used to upgrade a single VM at a time. To upgrade multiple VMs simultaneously multiple upgrade disks must be created for each simultaneous upgrade.
55+
To start an in-place upgrade the upgrade media must be attached to the VM as a Managed Disk. To create the upgrade media, modify the variables in the following PowerShell script for Windows Server 2022. The upgrade media disk can be used to upgrade multiple VMs, but it can only be used to upgrade a single VM at a time. To upgrade multiple VMs simultaneously multiple upgrade disks must be created for each simultaneous upgrade.
7256

7357
| Parameter | Definition |
7458
|---|---|
@@ -78,38 +62,43 @@ To perform an in-place upgrade the upgrade media must be attached to the VM as a
7862
| diskName | Name of the Managed Disk that will contain the upgrade media |
7963
| sku | Windows Server upgrade media version. This must be either: `server2022Upgrade` or `server2019Upgrade` |
8064

81-
### Script contents
65+
### PowerShell script
8266

8367
```azurepowershell-interactive
8468
#
8569
# Customer specific parameters
86-
#
70+
71+
# Resource group of the source VM
8772
$resourceGroup = "WindowsServerUpgrades"
73+
74+
# Location of the source VM
8875
$location = "WestUS2"
89-
$diskName = "WindowsServer2022UpgradeDisk"
76+
77+
# Zone of the source VM, if any
9078
$zone = ""
9179
92-
#
93-
# Selection of upgrade target version
94-
#
80+
# Disk name for the that will be created
81+
$diskName = "WindowsServer2022UpgradeDisk"
82+
83+
# Target version for the upgrade - must be either server2022Upgrade or server2019Upgrade
9584
$sku = "server2022Upgrade"
9685
97-
#
86+
9887
# Common parameters
99-
#
88+
10089
$publisher = "MicrosoftWindowsServer"
10190
$offer = "WindowsServerUpgrade"
10291
$managedDiskSKU = "Standard_LRS"
10392
10493
#
105-
# Get the latest version of the image
106-
#
94+
# Get the latest version of the special (hidden) VM Image from the Azure Marketplace
95+
10796
$versions = Get-AzVMImage -PublisherName $publisher -Location $location -Offer $offer -Skus $sku | sort-object -Descending {[version] $_.Version }
10897
$latestString = $versions[0].Version
10998
110-
#
111-
# Get Image
112-
#
99+
100+
# Get the special (hidden) VM Image from the Azure Marketplace by version - the image is used to create a disk to upgrade to the new version
101+
113102
114103
$image = Get-AzVMImage -Location $location `
115104
-PublisherName $publisher `
@@ -214,8 +203,25 @@ Once the upgrade process has completed successfully the following steps should b
214203

215204
- Enable any antivirus, anti-spyware or firewall software that may have been disabled at the start of the upgrade process.
216205

217-
## Recovery from failures
206+
## Workaround
207+
208+
For versions of Windows that are not currently supported, create an Azure VM that's running a supported version. And then either migrate the workload (Method 1, preferred), or download and upgrade the VHD of the VM (Method 2).
209+
To prevent data loss, back up the Windows 10 VM by using [Azure Backup](../backup/backup-overview.md). Or use a third-party backup solution from [Azure Marketplace Backup & Recovery](https://azuremarketplace.microsoft.com/marketplace/apps?page=1&search=Backup+&exp=ubp8).
210+
### Method 1: Deploy a newer system and migrate the workload
211+
212+
Create an Azure VM that runs a supported version of the operating system, and then migrate the workload. To do so, you'll use Windows Server migration tools. For instructions to migrate Windows Server roles and features, see [Install, use, and remove Windows Server migration tools](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012).
213+
214+
215+
### Method 2: Download and upgrade the VHD
216+
1. Do an in-place upgrade in a local Hyper-V VM
217+
1. [Download the VHD](./windows/download-vhd.md) of the VM.
218+
2. Attach the VHD to a local Hyper-V VM.
219+
3. Start the VM.
220+
4. Run the in-place upgrade.
221+
2. Upload the VHD to Azure. For more information, see [Upload a generalized VHD and use it to create new VMs in Azure](./windows/upload-generalized-managed.md).
222+
218223

224+
## Recover from failure
219225
If the in-place upgrade process failed to complete successfully you can return to the previous version of the VM if snapshots of the operating system disk and data disk(s) were created. To revert the VM to the previous state using snapshots complete the following steps:
220226

221227
1. Create a new Managed Disk from the OS disk snapshot and each data disk snapshot following the steps in [Create a disk from a snapshot](/virtual-machines/scripts/virtual-machines-powershell-sample-create-managed-disk-from-snapshot) making sure to create the disks in the same Availability Zone as the VM if the VM is in a zone.
@@ -233,4 +239,4 @@ If the in-place upgrade process failed to complete successfully you can return t
233239

234240
## Next steps
235241

236-
For more information, see [Perform an in-place upgrade of Windows Server](/windows-server/get-started/perform-in-place-upgrade)
242+
For more information, see [Perform an in-place upgrade of Windows Server](/windows-server/get-started/perform-in-place-upgrade)

0 commit comments

Comments
 (0)