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/change-availability-set.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,14 @@ This article was last tested on 2/12/2019 using the [Azure Cloud Shell](https://
31
31
## Change the availability set
32
32
33
33
The following script provides an example of gathering the required information, deleting the original VM and then recreating it in a new availability set.
34
+
The below scenario also covers an optional portion where we create a snapshot of the VM's OS disk in order to create disk from the snapshot to have a backup because when the VM gets deleted, the OS disk will also be deleted along with it.
34
35
35
36
```powershell
36
37
# Set variables
37
38
$resourceGroup = "myResourceGroup"
38
39
$vmName = "myVM"
39
40
$newAvailSetName = "myAvailabilitySet"
41
+
$snapshotName = "MySnapShot"
40
42
41
43
# Get the details of the VM to be moved to the Availability Set
42
44
$originalVM = Get-AzVM `
@@ -57,10 +59,30 @@ The following script provides an example of gathering the required information,
0 commit comments