Technical Thursday – Restore VM from RSV – unmanaged disk
As I promised last week I provide some materials for unmanaged disk based VM restore from Recovery Services vault. Last week I posted the concept for restore and now I show the most important steps on technical level.
Some useful information before you start the restore:
Required naming convention
OS disk and Data disks related vhds must be in the following format:
- OS disk:
- [vmname]-osdisk.vhd
- Data disk:
- [vmname]-datadisk-[diskid].vhd (where the diskid represents the value of lun)
- (example for 1st data disk: myvm-datadisk-0.vhd)
Prerequisites
- Azure-Cli 2.x
- Python 2.7
And now let’s see the steps one-by-one:
1. Stopped (deallocated) the target VM
This step is executable from PowerShell, Azure-Cli and Portal as well.
# Stop (deallocated) vm from Azure-Cli 2.x az vm deallocate --name <vm name> --resource-group <resource group name> --verbose
Be sure the VM is in Stopped (deallocated) status!
2.Delete necessary objects
In this step we have to delete target VM object (ONLY the virtual machine object) and vhd files which belong to target VM.
- Login your linux computer
- Download files from git
- Navigate the UnmanagedDisk directory
- Run this command to delete VM object and the corrupt VHDs
bash 01_deleteVMandVHDs.sh
3. Restore VM’s VHDs from backup vault
Choose the right restore point from Recovery Services vaults which belongs to target VM and Restore OSDisk and DataDisks to your storage account.
https://docs.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms
4. Move restored vhd files to original location
- Login your linux computer
- Download files from git
- Navigate the UnmanagedDisk directory
- Run this command to copy restored VHD files to the original location
bash 02_copyRestoredVHDs.sh
5. Re-create target VM with your ARM Template
In this step you merely redeploy your vm from that ARM template you had created for original vm creation.
I hope it helps to solve your restore VM problem. 🙂
Next week I will show you the managed disk based VM restore related steps…
If you need some help regarding ARM Template for restore or other scenarios do not hesitate to contact me.
Technical Thursday – Restore VM from RSV – managed disk – IT Blog for sharing
2018-02-22 @ 18:07
[…] week I provided the unmanaged disk related restore description which based on the concept for restore and now I show the managed disk […]