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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With