Export a VM from AHV raw format to VMware VMDK

In this example I’m going to export my Windows 2012 R2 template from AHV to ESXi.

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.  (Notice the size of the VM under the STORAGE column in PRISM, that should be the size of the exported file… assuming the VM only has 1 vdisk)




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.  The vdisk is exported in a thin format and should match the size of the VM in PRISM.

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

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

qemu-img convert -O vmdk nfs:// nfs://


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 and import it into ESXi.  Alternatively you could just mount the container as NFS on the ESXi host and storage vMotion it to another datastore.



Step 4.  Create a VM with the new vdisk and power it on.  Remember to install VMware Tools.


Leave a Reply

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