0

I'm looking into how to copy VMs from one subscriptions to another. After doing some research I found a lot of great articles describing the process on how to perform a move.

Examples

https://dzimchuk.net/moving-azure-vm-with-managed-disks-to-another-subscription/

Move Azure VM to other subscription in other region

However, one thing I'm wondering is: In the scenario of managed disk, why bother with the performing a snapshot saved to a blob > copying the blob > re-creating the VM. When you just save a snapshot to another subscription and then create a vm from that snapshot?

My reference:

https://learn.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-copy-snapshot-to-same-or-different-subscription

https://learn.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-create-vm-from-snapshot?toc=%2fpowershell%2fmodule%2ftoc.json

Alex Angas
  • 59,219
  • 41
  • 137
  • 210
Niklas Jern
  • 1
  • 1
  • 3

2 Answers2

0

There are some limitations for moving resources, for managed disks, Azure do not support to move and the same limitation for snapshot created from managed disks. So you cannot just save a snapshot to another subscription and then create a VM from that snapshot.

For more information about managed VM, please read the document here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-move-resources#virtual-machines-limitations

So, if you want to move managed VM, you could follow the link you post in stack overflow: https://dzimchuk.net/moving-azure-vm-with-managed-disks-to-another-subscription/

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • The limitations also state that you can't move a managed disk, but clearly its possible with the work around.Still not sure that I see why I can't save the snapshot to another subscription, as my reference link indicates that you can? – Niklas Jern May 24 '18 at 07:21
  • You cannot move managed disk or it's snapshot directly in Azure, but it's not absolute. For example, you can download the managed disk and upload to Azure again, then create a vm with the disk. So, we can achieve the target another way. – Charles Xu May 24 '18 at 09:28
  • 1
    Yes im aware of that, but I'm not sure that you get what I'm going for. inthe same manner as you can download the managed disk > uploaded it to a new sub > create a new VM. I'm asking if you can do the same with a snapshot, since according to : https://learn.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-copy-snapshot-to-same-or-different-subscription you can save the snapshot to a different sub. – Niklas Jern May 24 '18 at 12:25
  • I suggest that you should take care of the link https://learn.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-copy-snapshot-to-same-or-different-subscription you post, the action is copy, not move. We can copy snapshot from another subscription, even though another location. The limitation I post is all about movement. – Charles Xu May 25 '18 at 02:10
0

The link you are referring to is not creating snapshot in other subscription. It is getting the snapshot which is already created in a resourcegroup and then a copy is initiated.

the below code from the url does the same.

$snapshot= Get-AzureRmSnapshot -ResourceGroupName $sourceResourceGroupName -Name $snapshotName

So in actual you have to create a snapshot in the source subscription and then copy it in another subscription

aquib.qureshi
  • 557
  • 1
  • 8
  • 21