We have setup Virtual Machine Azure. Next question you may wonder on how to backup Azure Virtual Machine. Too bad at this moment, we cannot using System Center Data Protection Manager or Azure Backup to backup virtual machine. However can use these backup to backup application data.
Then we have search around and found out that we can use Blob Snapshot to perform backup by referring to Keith Mayer guide. You can refer to here.
There are four (4) steps that you need to in order to backup Azure Virtual Machine.
- Select virtual machine to back up
- Identify virtual hard disks
- Create cloud storage container for storing backups
- Back up virtual machines in Windows Azure to cloud storage
- Backup VM Configuration by using Export-AzureVM
Well, we follow the guide provide by Keith Mayer and summarize it in this script:-
#to list down entire VM in Azure
#Select 1 VM. Example: MS4UDir
#Temporary shutdown to a state when the virtual machine is not running but its configuration is kept in a provisioned state
#to get os disk
$VMOsDisk = $VM | Get-AzureOSDisk
#determine the name of Windows Azure Storage Account by using MediaLink property
#Setting the current storage account
#Creating a new Windows Azure Storage Container
#Confirming creation of storage container
#Backup virtual machine
#Get-AzureStorageBlobCopyState to confirm that the copy process completed
#Backup Data Disk
#Confirm that a copy of each virtual hard disk now exist in the backup storage container location.
#Start VM after backup complete
The process is length but at last we managed to backup the virtual machine.