Skip to content

Commit 0f9d704

Browse files
authored
Update os-disk-swap.md
1 parent f7fb1a0 commit 0f9d704

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

articles/virtual-machines/windows/os-disk-swap.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ ms.custom: devx-track-azurepowershell
1717

1818
If you have an existing VM, but you want to swap the disk for a backup disk or another OS disk, you can use Azure PowerShell to swap the OS disks. You don't have to delete and recreate the VM. You can even use a managed disk in another resource group, as long as it isn't already in use.
1919

20-
21-
22-
The VM does need to be stopped\deallocated, then the resource ID of the managed disk can be replaced with the resource ID of a different managed disk.
20+
The VM does not need to be stopped\deallocated. The resource ID of the managed disk can be replaced with the resource ID of a different managed disk.
2321

2422
Make sure that the VM size and storage type are compatible with the disk you want to attach. For example, if the disk you want to use is in Premium Storage, then the VM needs to be capable of Premium Storage (like a DS-series size). Both disks must also be the same size.
2523
And ensure that you're not mixing an un-encrypted VM with an encrypted OS disk, this is not supported. If the VM doesn't use Azure Disk Encryption, then the OS disk being swapped in shouldn't be using Azure Disk Encryption. If disks are using Disk Encryption Sets, both disks should belong to same Disk Encryption set.
@@ -36,7 +34,7 @@ When you have the name of the disk that you would like to use, set that as the O
3634
# Get the VM
3735
$vm = Get-AzVM -ResourceGroupName myResourceGroup -Name myVM
3836
39-
# Make sure the VM is stopped\deallocated
37+
# (Optional) Stop/ deallocate the VM
4038
Stop-AzVM -ResourceGroupName myResourceGroup -Name $vm.Name -Force
4139
4240
# Get the new disk that you want to swap in

0 commit comments

Comments
 (0)