Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move a Windows Azure VM to a different affinity group?

I created a VM in Windows Azure's West US data center. Now I find out it requires frequent connection with another VM I created on another machine in Windows Azure's East US data center. The second machine is already belonging to a affinity group. It will be best if I can move the first VM to the same affinity group as the second machine. Because there are already quite a bit of data in the first VM, data migration could be painful. Help!

After some experiments, I finally give up. Although I can successfully copy the vhd from one data center to the other, the configuration would not work. It is possible to make it work, but you would need to run sysprep command to erase the configuration information from the former data center.

like image 852
Albert Cheng Avatar asked Mar 09 '13 00:03

Albert Cheng


People also ask

How do I move Azure VM to another resource group?

Go to the Azure portal to manage the resource group containing the VM to move. Search for and select Resource groups. Choose the resource group containing the VM that you would like to move. At the top of the page for the resource group, select Move and then select Move to another resource group.

How do I move an Azure VM to another subnet?

In the Azure portal, click on VM's virtual network interface card (vNIC). Select the device and left side,IP configurations and choose the subnet where to move the server. Stop and deallocate the VM then delete only VM,then create the VM used by it's old disk.

Can they move the Azure virtual machines to a different subscription?

Virtual machines in an existing virtual network can be moved to a new subscription only when the virtual network and all of its dependent resources are also moved. Virtual machines created from Marketplace resources with plans attached can't be moved across subscriptions.


2 Answers

In new SDK the template command are:

azure vm disk upload “http://sourcestorage.blob.core.windows.net/vhds/sample.vhd” “http://destinationstorage.blob.core.windows.net/vhds/sample.vhd” “DESTINATIONSTORAGEACCOUNTKEY”

Don't forget to make the VHDs "public" and get the KEY on "Managed Key" option on Portal.

like image 198
paulorcf Avatar answered Nov 01 '22 11:11

paulorcf


You can perform an asynchronous blob copy from US West to US East (from one storage account to another), copying the VHD of your virtual machine. At that point, you should be able to start up the virtual machine in US East based on that vhd, within the correct affinity group.

There's a bit of work around creating an image from the virtual machine - this msdn resource should be a great starting place.

EDIT: You can execute an async blob copy via the Windows Azure cross-platform command line tools, available for Windows, Mac, and Linux (download here ). The syntax is:

azure vm disk upload <source-url> <target-url>

Source url is either a public blob or a private blob with shared access signature. The target url uses the storage account info you configure via the command-line tool:

azure config set defaultStorageAccount

More info on the command-line tools, here, including instructions for downloading subscription info.

like image 35
David Makogon Avatar answered Nov 01 '22 11:11

David Makogon