You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/windows-in-place-upgrade.md
+44-38Lines changed: 44 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,50 +4,34 @@ description: This article describes how to do an in-place upgrade for VMs runnin
4
4
services: virtual-machines
5
5
author: cynthn
6
6
ms.topic: how-to
7
-
ms.date: 01/17/2023
7
+
ms.date: 01/19/2023
8
8
ms.author: cynthn
9
9
10
10
---
11
11
12
12
# In-place upgrade for VMs running Windows Server in Azure
13
13
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.
15
15
16
16
Before you begin an in-place upgrade:
17
17
18
18
- Review the upgrade requirements for the target operating system:
19
19
20
-
- Upgrade options for Windows Server 2019
20
+
- Upgrade options for Windows Server 2019 from Windows Server 2012 R2 or Windows Server 2016
21
21
22
-
- Upgrade options for Windows Server 2022
22
+
- Upgrade options for Windows Server 2022 from Windows Server 2016 or Windows Server 2019
23
23
24
24
- 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.
25
25
26
26
- 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.
27
27
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:
30
30
31
31
- Windows Server 2012 Datacenter
32
32
- Windows Server 2012 Standard
33
33
- Windows Server 2008 R2 Datacenter
34
34
- 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
-
51
35
52
36
## Upgrade VM to volume license (KMS server activation)
53
37
@@ -68,7 +52,7 @@ We recommend that you create a snapshot of your operating system disk and any da
68
52
69
53
## Create upgrade media disk
70
54
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.
72
56
73
57
| Parameter | Definition |
74
58
|---|---|
@@ -78,38 +62,43 @@ To perform an in-place upgrade the upgrade media must be attached to the VM as a
78
62
| diskName | Name of the Managed Disk that will contain the upgrade media |
79
63
| sku | Windows Server upgrade media version. This must be either: `server2022Upgrade` or `server2019Upgrade`|
80
64
81
-
### Script contents
65
+
### PowerShell script
82
66
83
67
```azurepowershell-interactive
84
68
#
85
69
# Customer specific parameters
86
-
#
70
+
71
+
# Resource group of the source VM
87
72
$resourceGroup = "WindowsServerUpgrades"
73
+
74
+
# Location of the source VM
88
75
$location = "WestUS2"
89
-
$diskName = "WindowsServer2022UpgradeDisk"
76
+
77
+
# Zone of the source VM, if any
90
78
$zone = ""
91
79
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
95
84
$sku = "server2022Upgrade"
96
85
97
-
#
86
+
98
87
# Common parameters
99
-
#
88
+
100
89
$publisher = "MicrosoftWindowsServer"
101
90
$offer = "WindowsServerUpgrade"
102
91
$managedDiskSKU = "Standard_LRS"
103
92
104
93
#
105
-
# Get the latest version of the image
106
-
#
94
+
# Get the latest version of the special (hidden) VM Image from the Azure Marketplace
# 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
+
113
102
114
103
$image = Get-AzVMImage -Location $location `
115
104
-PublisherName $publisher `
@@ -214,8 +203,25 @@ Once the upgrade process has completed successfully the following steps should b
214
203
215
204
- Enable any antivirus, anti-spyware or firewall software that may have been disabled at the start of the upgrade process.
216
205
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
+
218
223
224
+
## Recover from failure
219
225
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:
220
226
221
227
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
233
239
234
240
## Next steps
235
241
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