Share via


How to Move Azure VM to Different Affinity Group

Part 1. Copy out VHD

1. download Azcopy from: https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/

2. create a storage space with specified AG.

Untitled picture 

3. create a container named "vhds" in the new storage space.

2

4. get the access key.

4

5. run the following azcopy command:

C:\workspace\azcopy-v5.0.0\AzCopy>AzCopy.exe /source:https://chportalvhdsqgdvm4s5bhfg.blob.core.windows.net/vhds /Dest:https://scwss.blob.core.windows.net/vhds /SourceKey:p6tmPoICh899idKouXMJGpCXV1ZBib0yAOPglwUdSEdkV/IftV9dnY6ZJYEFp7eiJ1ZW/kYa235tMQBY4bR9xw== /DestKey:4QurY5HCu3YTawpzOjXCmzKDCLi7TD6SD3dChBSJ5lOhz1RYy47MvSenwPu9z+2Tg1C3nLvpPyChQE0wkCJ8CQ== /S

[2016/04/06 11:56:34][ERROR] CNus1510.CNus1510.CNus1510.status: Failed to copy from "https://chportalvhdsqgdvm4s5bhfg.blob.core.windows.net/vhds/CNus1510.CNus1510.CNus1510.status" to "https://scwss.blob.core.windows.net/vhds/CNus1510.CNus1510.CNus1510.status". Copy status: Failed.
Finished 1 of total 2 file(s).
[2016/04/06 12:15:55] Transfer summary:
-----------------
Total files transferred: 2
Transfer successfully: 1
Transfer skipped: 0
Transfer failed: 1
Elapsed time: 00.00:19:25

5

Part 2. Create a VM disk 22

Part 3. Create a VM and specify the existing VHD file

1. Create a VM on top of specified the VHD file.

21

2. refer the following article and commands to reset the password:

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-classic-reset-access/

azure vm extension set CNus1510scw VMAccessForLinux Microsoft.OSTCExtensions 1.* --private-config-path C:\workspace\publishsettings\PrivateConf.json 6