Alan Wolman
Alan Wolman

Reputation: 683

How do I migrate an existing Windows Azure VM to a Windows Azure virtual network?

I would like to migrate our test server - a Windows Azure VM running Windows 2008 server (running AD DC and variety of apps such as Dynamics CRM) - to a virtual network.

I am looking for a safe way to migrate the server to the virtual network.

My research to date indicates that I can create a new VM using the same OS disk. However when I attempt to create a new VM the existing OS disk is not visible in the list of images.

Is anybody able to point me in the right direction as to how this is achieved? Also, do you have any recommendations with respect to a rollback strategy (e.g. Backup tools)?

Alan.

Upvotes: 0

Views: 692

Answers (1)

astaykov
astaykov

Reputation: 30903

I haven't verified the flow, but it should be working fine. Follow these steps:

  1. Make sure you are not using static IP on your AD/DC. The IP Addresses in Azure shall always be DHCP allocated!
  2. Shut down the AD/DC
  3. Copy the VHD blob to a new blob! I strongly suggest that you have the OS Disk (VHD blob) in a storage account which is in the same affinity group as the Virtual Network. So, if the current OS Disk is not in a Storage Account, which is in the same affinity group as the VNet, create a new storage account and copy the original VHD there. Please note that you should copy the blob only when the VM is shut down!
  4. Create the sub-net you want to bring the VM in. (probably you already have created it).
  5. Create a new VM using the copied VHD as an OS Disk and selecting the Virtual Network and sub-net.

Possible gotchas with this migration:

  • IP Address of AD/DC will change when added to the Virtual Network. Be prepared and never assign static IP Address to a VM in Azure
  • You will not see the VHD in the list of possible images to use - in that case use some kind of storage explorer (such as Cloud Storage Studio) to make sure there is no existing lease on the blob with the VHD. If there is a lease - break it!
  • A suggested VNet setup for AD/DC/DNS infrastructure in azure is clearly described in this blog post

Upvotes: 1

Related Questions