Forum Discussion
VinÃcius Barreto
Jun 11, 2017Copper Contributor
Move virtual machine between different accounts
Hello guys!
Do you know if it is possible to move a virtual machine to another Azure account?
- Hi, There is no direct way to migrate a vm from One Account to an other, of we speack about separate subscription from different owner. There a to possible ways - Grant the user of One subscription rights in the other subscription so that this user is able to use both subscription. Than you can move a vm and all relaxed resources to the other subscription. The other way is to just move the vhd-files from one storage account to an other by using e.g. Azcopy. In this case you only need the Security Information of the Storage account. But After the copy you have to rebuild the vm. Regards Niels
- marusa7044Copper Contributor
Yes, it is possible to move a virtual machine (VM) from one Azure account to another, but it involves a process called "Azure Cross-Subscription Move" or "Azure VM Migration." This process allows you to transfer resources, including virtual machines, from one Azure subscription to another, which can be helpful in scenarios such as organizational restructuring, billing changes, or mergers and acquisitions.
Here's an overview of how you can perform a cross-subscription move for a virtual machine:
Prerequisites:
Azure Subscription Access: You need access to both the source (current) Azure subscription and the target (destination) Azure subscription.
Resource Group: The VM you want to move should be located within a resource group. You cannot move individual resources between resource groups; you need to move the entire resource group.
Resource Dependencies: Ensure that all resources associated with the VM, such as virtual networks, storage accounts, and network security groups, are within the same resource group or can be moved together.
Steps to Move a Virtual Machine:
Prepare the Source and Target Subscriptions:
- Ensure that you have the necessary permissions in both the source and target subscriptions.
Create a Snapshot or Backup (Recommended):
- It's a best practice to create a snapshot or backup of your VM before initiating the move to ensure data integrity.
Initiate the Move:
- In the Azure portal, navigate to the source subscription.
- Select the resource group containing the VM you want to move.
- Click "Move" in the toolbar, then select "Move to another subscription."
- Follow the prompts to select the target subscription and resource group.
Review and Confirm:
- Review the resources to be moved and confirm the move operation.
Monitor Progress:
- The move process can take some time to complete, depending on the size and complexity of the resources being moved. You can monitor the progress in the Azure portal.
Validation and Testing:
- After the move is complete, thoroughly validate the VM and its associated resources in the target subscription to ensure everything is functioning correctly.
Update DNS and Connectivity:
- If your VM relies on DNS records or connectivity configurations, update them to reflect the new subscription and resource group.
Post-Move Cleanup:
- In the source subscription, you can choose to delete the resource group (if it no longer serves a purpose) or keep it for reference.
Please note the following considerations:
Resource Dependencies: Ensure that all resources associated with the VM can be moved together. If any dependencies cannot be moved, you may need to recreate them in the target subscription.
IP Addresses: VMs with public IP addresses may require reconfiguration of DNS records or reassignment of public IPs in the target subscription.
Data Transfer Costs: Be aware of potential data transfer costs associated with moving resources between subscriptions, especially if data needs to be transferred between regions.
Resource Locks: Ensure that there are no resource locks in place that could prevent the move operation.
Resource Limits: Be aware of resource limits and quotas in the target subscription to accommodate the new resources.
Before proceeding with a cross-subscription move, it's recommended to thoroughly plan and understand the implications of the move, especially in production environments, to minimize disruption and ensure a smooth transition.
- MSUser_since_1980sCopper ContributorYour answer skips all the detailed steps despite being very long. It also suggests that the public IP address of a VM may be lost, which requires a longer downtime just to push out DNS and firewall changes globally. Is there a way to keep the IP address and just change the Microsoft "Entra" account e-mail within an organization that isn't using AAD for local authentication. In my case I am cleaning up account problems by setting up a second account with a new but similar e-mail unique to one purpose that includes 2 running VMs in two regions.
- kasunsjcIron Contributor
If the both subscriptions are in same tenant you can migrate VMs between subscriptions.
Use following doc
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/move-vm
If you want to move resources between two tenents then you have to use alternative method. We can use Azure Storage explore to copy VHDs from one SA to other SA in different tenant. Then using PowerShell or Azure CLI script we can create a VM from that VHD.
- Niels OpheyBrass ContributorHi, There is no direct way to migrate a vm from One Account to an other, of we speack about separate subscription from different owner. There a to possible ways - Grant the user of One subscription rights in the other subscription so that this user is able to use both subscription. Than you can move a vm and all relaxed resources to the other subscription. The other way is to just move the vhd-files from one storage account to an other by using e.g. Azcopy. In this case you only need the Security Information of the Storage account. But After the copy you have to rebuild the vm. Regards Niels
- AAfanaCopper Contributor
Niels OpheyDoes this work for real?
- Kesavan MunuswamyCopper ContributorThanks for very helpful information
- VinÃcius BarretoCopper ContributorThank you!
- Uzair Ahmad ChCopper Contributor
Are you able to understad what to do?