Moving a Windows Azure Virtual Machine from one Virtual Network to Another

Today I was trying to find an easy way to move a virtual machine from one Virtual Network to another, but wasn’t successful. So I played around until I figured it out, and thus the next time someone (such as myself) searches for a solution, they will find it here! This will be fairly quick once you know what to do. Below, I have a virtual machine named w2k8-02 that I want to move from the Virtual Network named p2stest to the Virtual Network named scomp2stest (and yes, I am doing some experimenting with SCOM 2012 and Point-to-Site VPN connections, but that is for another time!).

image

Let’s go to the Virtual Machines page and locate your virtual machine, as seen below. Select the arrow, which takes you to the detail page for the virtual machine.

image

The virtual machine detail page should land on the Dashboard tab. Note the OS disk name on the lower part of the page, as seen below. You will need this name when you attach the disk to the new virtual machine we will create.

image

Now, return to the virtual machines instances page, as seen below. Select the virtual machine you would like to delete (to the right of the name so you won’t go to the detail page), and then select the Delete button on the lower toolbar. This will not delete the underlying disk of the virtual machine, which we will see in just a moment.

image

Once you receive verification in the status bar that the virtual machine has been deleted, select the Disks tab, as seen below. Locate the virtual machine disk name that you noted earlier, and verify that it no longer has a value in the Attached To column.

image

We are almost ready to create the new virtual machine, but you must now wait several minutes before attempting to reuse the disk, as putting it back in the disk pool takes some time to process. On the bottom left-hand corner, select the “ + NEW” button, then Compute | Virtual Machine | From Gallery, as seen below.

image

You will now see the Create a Virtual Machine wizard. Select the “MY DISKS” tab to the left. If you do not see your disk, then you need to exit the wizard and wait a few more minutes. Once you do see the disk, select it and go to the next page.

image

On the Virtual machine configuration page, give the virtual machine the same name as before, or another name if you so desire. Go to the next page.

image

On the Virtual machine mode page, provide a unique DNS name, as you will not be able to use the previous DNS name since it is still marked as in use. In the Region/Affinity Group/Virtual Network dropdown, select the desired Virtual Network that you would like to move your virtual machine to.

image

On the Virtual machine options page, select an availability set or create a new one as desired. Select the final check mark to complete virtual machine creation.

image

Once the virtual machine has been created, go to your Virtual Network and verify in the dashboard that your virtual machine is there, as seen below. I have moved my virtual machine named w2k8-02 from p2stest to scomp2stest successfully.

image

And there you have your Virtual Machine now moved to another Virtual Network. See you again soon!