Albert Cheng
Albert Cheng

Reputation: 657

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.

Upvotes: 6

Views: 6574

Answers (2)

paulorcf
paulorcf

Reputation: 43

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.

Upvotes: 2

David Makogon
David Makogon

Reputation: 71025

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.

Upvotes: 1

Related Questions