Header Image - Acropolis.Ninja

Tag Archives

2 Articles

Export A VM on Nutanix 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.



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://[container]/.acropolis/vmdisk/[UUID] –O qcow2 nfs://[container]/[vmdisk].qcow2

qemu-img convert -c nfs:// -O qcow2 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.


Customize linux guests with AHVs built in cloud-init feature.

The time was finally here.  I have been slammed lately with meeting and installs and meeting new partners.  Today, I had a scheduling cancellation so finally had some time to test out this cloud-init feature.  For those unfamiliar (including me until recently), cloud-init is a “defacto multi-distribution package that handles early initialization of a cloud instance.”  You can read more about the features here.

Anyways, using the feature with regards to AHV (Acropolis Hypervisor) is actually pretty easy.  Basically, on AHV the installation of cloud-init is automated for you.  To use this feature there a few things you must know and knock out first.

  1.  Configure your linux master template the way you want.  I installed a new Centos 6.5 one from iso.  Configure the root passwd, and also delete the persistent rules in /etc/udev/rules.d/persistent-rules-net.rules.
  2. Install the cloud-init package. “yum install cloud-init”
  3. You will also need a cloud-init config file for when we provision the new server vm.  You can create your own file, but I will show you the quick generator I wrote.
  4. Create your own file or generate one with the generator.  You will need to vi the file first and set your envirnment specifics such as domain name and username, etc.
  5. Screenshot 2016-06-03 18.37.44
  6. Run the cloud-init-generator by typing ./cloud-init-generator
  7. It will ask you for the hostname.  Specify it.  Boom, now you have a file with the same name:
  8. Screenshot 2016-06-03 18.40.20
  9. Now assuming you are using AHV’s built in IPAM with managed networks you don’t have to worry about specifying IP address information.  IP will be set for the life of the VM.  Let’s now create the new VM.  High light your existing template and choose “Clone.”
  10. Screenshot 2016-06-03 18.29.40
  11. Now lets scroll to the bottom and upload the file we just created.
  12. Screenshot 2016-06-03 18.41.58
  13. That’s it!  We now have a system that has the hostname set, nutanix user created on the network thanks to our managed network.