How to Copy/Move an Azure VM between Regions and VNets

I will demonstrate how to copy a VM to a different region and a different subnet. For some background, this is not a trivial task at first thought.

So how about move/copy VM to a region from Canada Central to East US?

There are a few ways, but I will show how to do with Azure Storage Explorer and Creating a VM from a managed disk.

Prerequisite:

  1. Download and Open Azure Storage Explorer. https://azure.microsoft.com/en-ca/features/storage-explorer/
  2. Sign in with your azure credentials.
  3. You can see the subscriptions and any managed disks of your VMs.
  1. Identify the source VM. Ensure to shutdown.

2. Note the location and its VNET

3. Go to Disks an click on the OS Disk Name

4. In this Managed Disk, see the Resource Group name. In this case it is rkDevTestLab-VSDev-526882.

5. Now go to the Azure Storage Explorer and under Managed Disk look for this resource group name

You will see the managed disk of the VM.

6. To prepare to copy, simply right click Copy or click the Copy button in the toolbar.

7. Click into your target resource group to paste the managed disk. Click Paste

8. You will be prompted to fill the following. Ensure to set the target region.

9. Wait at least a few minutes to copy. Monitor the Activities Pane

10. Once complete, go to the Azure Portal the managed disk resource. Note that this disk is not attached and the desired location. You can click Create A VM.

11. Set the desired configuration settings. Note that the VNet and disk and VM has to be in the same region. The image field is the managed disk.

In the networking section, this is the opportunity to associate the target VNet and subnet.

Finish with the settings and click Create

12. This new VM is now in the desired location and in the desired VNET

Note: You can decide to delete the source VM.

Conclusion

If you are in a situation where you need to reorganize the location of VMs and its VNets, this is one of a handful of techniques. The key advantage is that I don’t have to do any PowerShell scripting to do the move across regions. This is where Azure Storage Explorer handled that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s