1

I tried to figure out what’s the best way to backup and restore a VM with Azure RM. I found the obvious: The recovery services fault with the two recovery options “Create virtual machine” and “Restore disks”. I found the unexpected: There is no easy way to restore a virtual machine without former deletion of the old VM.

What I currently do:

  • Run “Restore VM” with the “Restore disks” option to get the vhd
  • Stop the VM
  • Break the lease of the VMs vhd blob
  • Blob Copy the restored vhd over the VMs vhd
  • Start the VM

This works. The definition of the VM isn’t touched. VMs with special configurations keep their configuration. This is relative simple, but I wonder why it isn’t recommended.

Is there a hidden caveat of the method described above?

Are there other (better?) methods of restoring a VM without touching its configuration?

  • Based on my knowledge, you don't need to delete original VM, when you select Restore VM, it will create a new VM. The VM could be in other resource group and VNet. – Shui shengbao May 10 '17 at 9:38
  • I am aware of this. I want to restore the VM in-place without creating a new one to keep its settings. – Dirk Brockhaus May 10 '17 at 9:40
  • I suggest you could select Static Public IP associate the IP to the new VM. The IP address will not change. – Shui shengbao May 10 '17 at 9:42
  • You could restore your VM to the same VNet and associate Static Public IP to it and your settings will not change. – Shui shengbao May 10 '17 at 9:44
  • But there is more to consider: Different network settings (more than one nci), network security, diagnostics configuration. And this list is growing with every new object in the Azure portal. I would like to have a fully automated VM restore without a manual configuration change after the restore. – Dirk Brockhaus May 10 '17 at 9:49
1

Azure Backup doesn't replace the running VM but creates a new one. Unfortunately, post-restore you have to reconfigure network settings to make sure they match with the old one. You also need to add the new VM to Azure Backup unless you restore it with the same name and to the same resource group as the original - need to kill original VM first.

Restoring VMs with special configurations like load balancers, multiple NICs, or that previously were in availability sets is not possible. You have to recreate all these configurations manually. A good approach is to restore the disks and to use PowerShell scripts (or arm templates) to deploy a new VM with the original restored disks. That way you can customise the restored VM to be exactly like its source.

Ref.:

Restore backed up disks

Use templates to customize restore vm

  • 2
    In my question I describe the method to restore VMs with special configuration. It is possible. But official documentation argues as you do and that makes me insecure. And that makes me placing this question. – Dirk Brockhaus May 10 '17 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.