In this article I want to show you how to export a Nutanix AHV VM.
Currently it is not possible to export a VM via PRISM, so we have to do it via the CLI.
STEP 1: Find the vDisk UUID
Log in to one of the CVM (Controller Virtual Machine) via SSH.
After connecting to the CVM, we execute the command aCLI following from vm.list. This step is only necessary if you do not know the exact name of your VM.)
nutanix@NTNX-353e740a-A-CVM:10.42.10.12:~$ acli vm.list
VM name VM UUID
Now the VMDISK UUID is determined by acli vm.get [VMNAME].
As can be seen in the red frame above, the VMDISK UUID for the VM to be exported is “4d984220-6879-4a75-a130-09b2b0be3ce5”.
STEP 2: Export the VMDISK
Since the vDisk at Nutanix AHV is located in a hidden folder .acropolis, we have to export it with qemu-img converter.
When exporting, as a result of Thin-Disk, only what is actually occupied is exported!
Make sure the VM is turned off, then execute the appropriate command:
qemu-img convert -c nfs://127.0.0.1/[container]/.acropolis/vmdisk/[UUID] -O qcow2 nfs://127.0.0.1/[container]/[vmdisk].qcow2
Here is my example:
qemu-img convert -c nfs://127.0.0.1/default-container-42872125767206/.acropolis/vmdisk/01899c9e-f2c7-47f8-8d58-5c6017263d06 -O qcow2 nfs://127.0.0.1/default-container-42872125767206/ctx-dc01.qcow2
Depending on system performance, CVM load and SSD/HDD speed this may take some time.
Now the container can be mapped and copied in a workstation (Mac, Win or Linux…). Don’t forget to whitelist the corresponding IP in the Nutanix system!
In my case, I export the vDisk directly to another AHV cluster