This is the process we use to kill and restore vms that have customized configurations and installed applications. We will keep snapshot copies of both the OS and Data drives to be able to use again.
A. Kill VM Process
1. Take snapshots of OS and Data Disks
- Portal > Resource Group > Select OS Disk > Create Snapshot > Save in different Resource Group, Save as Standard HDD
- This Resource Group and all of its contents will be deleted after snapshots of the disks are taken.
- Make note of any special Network Security Group (NSG) rules used for the installed applications on the disks.
2. Delete the Resource Group containing the VM and all of its resources:
B. Restore the VM
- Read here for How To Create A VM from Snapshots of OS and Data disk – PowerShell
- The following steps for restoring the VM are shown using the Azure Portal
1. Create Managed disks from the saved OS and Data Disks
Create a Resource > New > Managed Disk > Create managed Disks >
2. Create VM from Managed OS and Data Disks
- To create the new VM > Disks > Select the managed OS disk just created – it will have no ‘Owner’ (neither does the Data disk just created in B1 above) > Create VM:
- Choose the OS and Data disks, set up the network options etc.:
3. Verify RDP Connection to new VM and installed applications and settings