How to copy/clone Azure VM over tenants?

Vinod 6 Reputation points
2022-11-23T10:28:06.153+00:00

I have a requirement to copy running VMs to another Tenant (Tenant-A --> Tenant-B). I tried to take OS/data disk snapshots and copied to source blob storage (in Tenant-A) and then copied to destination storage (in Tenant-B), now I am unable to use the snapshots from destination blob storage to create/convert disks. Kindly help me

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,065 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
569 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jonathon Kindred 406 Reputation points
    2022-11-23T10:34:26.133+00:00

    This guide will give you the information you need to copy your VM over Azure Tenants:

    https://www.remotelyrmm.com/blog/how-to-migrate-an-azure-virtual-machine-from-one-tenant-to-another


  2. Jonathon Kindred 406 Reputation points
    2022-11-23T11:49:37.417+00:00

    I guess that guide is a bust then in terms of what you want to do. In that case if you want the old VM to continue in the background I'd suggest to:

    1. Firstly import the publishsettings files for your subscriptions using Get-AzurePublishSettingsFile and Import-AzurePublishSettingsFile if this is the first time you are going to use them in PowerShell.
    2. Execute the attached script (replacing values with your own information)263350-copy-vm-powershell-script.txt
    3. On the destination you will have to create a disk from the VHD that was copied. So, in the portal click on Virtual Machines –> Disks –> Create Disk and follow the wizard to create a new disk from the VHD you copied. Make sure to tick the box that says it includes an Operating system.
    4. You should be able to select it from "my disks" when creating a new VM
    0 comments No comments