Export a VM on AHV

Step 1: Find UUID of the vDisk.

Connect to a CVM, enter aCLI and run the command vm.get [vm name]

Copy the vmdisk_uuid.

image

image

Step 2: Export the vDisk

vDisks of AHV VMs are located in a hidden folder on the container named .acropolis.  We use the qemu-img command to export the vDisk.  One cool thing is that the vDisk is exported in a thin format, so even if it is provisioned as a 100GB drive, it will only export the actual size used.

Make sure the VM is powered off, then run the following command:

qemu-img convert –c nfs://127.0.0.1/[container]/.acropolis/vmdisk/[UUID] –O qcow2 nfs://127.0.0.1/[container]/[vmdisk].qcow2

Example:
qemu-img convert -c nfs://127.0.0.1/Nutanix/.acropolis/vmdisk/5c0996b9-f114-475f-98c0-ea4d09e8e447 -O qcow2 nfs://127.0.0.1/Nutanix/export_me.qcow2

Step 3: Copy the vDisk

Once the export completes, you can now whitelist a Windows 2012 R2 server and simply browse to the container and copy the vDisk.

image

Leave a Reply

Your email address will not be published. Required fields are marked *