Copy managed disk between subscriptions

6.6k Views Asked by At

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

2

There are 2 best solutions below

4
On

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/

0
On

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