Azure – Cloning Virtual Machine On Azure, keeping existing

azurecloningvirtual-machines

There doesn't seem to be a straight answer online about this. I have an existing Virtual Machine on Azure and I want to clone it to another region in case my existing server goes down. It needs to be the exact replica but all I can find are moving virtual machines, not cloning. I assume you can't do a certain type of clone maybe because of the computer names cant be the same for the VM.

Is there a good article on what to do, or should I start from scratch and build the virtual machine up again trying to replicate what I already have?

Best Answer

If you are using classic deployment, basically all you have to do is:

  1. Sysprep your server (Windows) or deprovision the agent (Linux)
  2. Hit Capture using the portal to create an image of your VM
  3. Use Azcopy to copy the VHD file generated to the secondary region
  4. Create new image (secondary region) using the VHD file you just copied
  5. Deploy a new virtual machine using this image (secondary region)

If you are using ARM, read this.

References:

Capture an image of an Azure Windows virtual machine

How to capture a classic Linux virtual machine as an image

Transfer data with the AzCopy Command-Line Utility

Related Topic