How to clone an Azure VM

Josh picture Josh · Apr 24, 2014 · Viewed 8.4k times · Source

Is there a simple method of cloning an Azure VM? So far I have found that you can "Deprovision" a VM, run "Sysprep" on it, and then "capture" an image. More on that here. It requires you to shutdown the Virtual Machine.

What I had been hoping for was a simple "Clone VM" that doesn't require a machine shutdown or (if it does require a shutdown) will at least do it via an automated process, automatically bringing the VM back up as soon as the "capture" is complete. Is there a way to do this, preferably via the Azure management console?

Answer

kunal picture kunal · Apr 30, 2014

You can automate the process of taking back up of VM on azure by use of Powershell. The following command can be used to perform this operation -

Start-CopyAzureStorageBlob -SrcContainer vhds -SrcBlob $blobName -DestContainer vhds -DestBlob $blobName -Context $sourceContext -DestContext $destContext -Force

The whole process is mentioned at the link - http://blogs.msdn.com/b/microsoft_press/archive/2014/01/29/from-the-mvps-copying-a-virtual-machine-from-one-windows-azure-subscription-to-another-with-powershell.aspx?Redirected=true

If you wish to stop the blob copy started by mistake you can refer to the details provided in this link - http://sanganakauthority.blogspot.com/2014/04/stop-copy-of-azure-virtual-machine-from.html

Hope this helps