Thursday, July 4, 2013

Copy Virtual Machines in Azure from One Subscription to Another

Why do I need to copy VM in Azure to another subscription - 
( most heard or possible scenarios )
a) Free Trial account about to expire, so transfer the VM to a new Trail account. :-)
b) Move the VM from personal account to paid subscription account.
c) Move VM to a subscription that is closer to your base work location (e.g. EU or Asia)

I have tried to provide the prerequisite and possible solution, hope you all like it.

Prerequisite: Download and install the Node.js tool from http://nodejs.org 

Possible Solution:
Then, run the following command from the Node.js command prompt 
            Windows Machinenpm install azure–cli (Need to run in administrator mode).
            Linux Machinesudo npm install azure–cli (Need to run this command with elevated privileges).
To make sure your installation was successful, type azure in the command prompt. To list all the Azure related commands.
Command - azure vm disk upload "Source VHD Path" "New Azure Subscription Azure destination path" "Destination Storage Account Key"
Example:
azure vm disk upload “http://sumitsancheti.blob.core.windows.net/vhds/sample.vhd” “http://sumit-newazure.blob.core.windows.net/vhds/sample.vhd” “DESTINATIONSTORAGEACCOUNTKEY”

Hope the above was helpful.
Please share your views, as it will help me to be a better blogger.

Next Article to be Published : How to copy Virtual Machines running in Azure to local machine?

No comments:

Post a Comment