Is it possible to live migrate a VM from one AHV cluster to another AHV cluster ? | Nutanix Community
Skip to main content
Solved

Is it possible to live migrate a VM from one AHV cluster to another AHV cluster ?


Is it possible to live migrate a VM from one AHV cluster to another AHV cluster ? or live migration is only within one AHV cluster ??

Best answer by smueller

There is actually no way, to migrate live VMs from Cluster to Cluster.

We have a workaround for this, which requires the VMs to be offline:

You can export the VM in QCOW2 on the commandline on AHV Cluster A.
Download the file and import on the AHV Cluster B.
After importing the image, you can set up an new VM and clone the disk out of the imported file.

  • Log in to the shell of your CVM
  • Get the Container your VM is stored with nfs_ls
  • Get the vmdisk_uuid with the command "acli vm.get "
With this information, you can create the following command on the shell (just replace the placeholders , and ):
code:
qemu-img convert -f raw nfs://127.0.0.1//.acropolis/vmdisk/ -O qcow2 /home/nutanix/.qcow2


Download it with SCP or another software.
Import via Image Configuration on the target system.
View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

10 replies

Forum|alt.badge.img+19
  • Trailblazer
  • 26 replies
  • February 1, 2018
Hi sd11,

The live migration is always within the same cluster..

F>P

  • Voyager
  • 1 reply
  • Answer
  • February 1, 2018
There is actually no way, to migrate live VMs from Cluster to Cluster.

We have a workaround for this, which requires the VMs to be offline:

You can export the VM in QCOW2 on the commandline on AHV Cluster A.
Download the file and import on the AHV Cluster B.
After importing the image, you can set up an new VM and clone the disk out of the imported file.

  • Log in to the shell of your CVM
  • Get the Container your VM is stored with nfs_ls
  • Get the vmdisk_uuid with the command "acli vm.get "
With this information, you can create the following command on the shell (just replace the placeholders , and ):
code:
qemu-img convert -f raw nfs://127.0.0.1//.acropolis/vmdisk/ -O qcow2 /home/nutanix/.qcow2


Download it with SCP or another software.
Import via Image Configuration on the target system.

Forum|alt.badge.img+19
  • Trailblazer
  • 26 replies
  • February 1, 2018
Just to add you can also use native replication to replication the VM using data protection and failover to target cluster with minimum downtime.


F>P

aluciani
Forum|alt.badge.img+34
  • Chevalier
  • 348 replies
  • February 12, 2018
Hi @sd11 if you find any of these answers help - consider clicking the 'Best Answer' button. That will help other community members a reply that worked. Thanks

Forum|alt.badge.img+8
I got this error running the command below:

nutanix@NTNX-17SM76230071-A-CVM:10.250.64.132:~$ qemu-img convert -f raw nfs://127.0.0.1/NTX-US-WAXD3-SC1/.acropolis/vmdisk/9a33d684-0f8d-4103-82bc-2f83c43f5ed2 -O qcow2 /home/nutanix/USWAXTA002-DISK0.qcow2 &
[1] 24056
nutanix@NTNX-17SM76230071-A-CVM:10.250.64.132:~$ qemu-img: Could not open 'nfs://127.0.0.1/NTX-US-WAXD3-SC1/.acropolis/vmdisk/9a33d684-0f8d-4103-82bc-2f83c43f5ed2': Failed to open file : open call failed with "NFS: ACCESS denied. Required access r--. Allowed access ---"
^C

srslol
Forum|alt.badge.img+16
  • Adventurer
  • 9 replies
  • June 8, 2018
Hey @billytiangco - Did you get a fix for the permissions?

Forum|alt.badge.img+3
  • Trailblazer
  • 23 replies
  • September 21, 2018
@billytiangco Probably sudo this conversion?

Forum|alt.badge.img+8
  • Trailblazer
  • 20 replies
  • January 21, 2020

@aluciani do you know if there is any update to this ability?  This thread is a year old but I cannot seem to find more current info.


Forum|alt.badge.img+8
  • Trailblazer
  • 20 replies
  • January 22, 2020

I talked to engineers yesterday, and this ability is on the product roadmap. I have been asked to not mention dates or release numbers but it seems to be not to far off.  JL


FredPassos
Forum|alt.badge.img+1
  • Voyager
  • 2 replies
  • February 17, 2022
jlackman wrote:

I talked to engineers yesterday, and this ability is on the product roadmap. I have been asked to not mention dates or release numbers but it seems to be not to far off.  JL

Migrating VMs Between AHV Clusters | Nutanix University