Nutanix AHV: Multi-Site Distributing reference images
When you are using Acropolis Hypervisor (AHV) in your environment, you will notice some difficulties, which you don’t have using VMware. Of course, this is completely understandable regarding the years of development in VMware, and those years in AHV.
Luckily Nutanix provides multiple interfaces you can use to accomplish your tasks.
One of my latest challenges was to make sure the same reference image was used on all Nutanix clusters, located on different sites. I did not want my customer to use sftp to download the reference image from one side, and then use sftp again to upload the image to the remote site. Of course you can use an URL when creating a new image, but in my opinion that is not preferred for sites with limited bandwidth on the WAN connection.
Using a Protection Domain
I decided to use a Protection Domain to replicate the ‘ImageServer’ to all remote locations. The Ultimate license, needed for Multiple Site DR, was available at this customer. Of course, the initial replication can take a while, but after the first replication, only the changes in de ‘ImageServer’ have to be replicated.
Exporting the Reference Image vm
When replication has succeeded, a few lines of code has to be run at the destination site.
- First of all, the ‘ImageServer’ has to be restored from the latest snapshot. In an earlier post, I described how I use Powershell to restore a VM from a snapshot. A few lines will make sure, you will restore the latest version.
$snap = Get-NTNXProtectionDomain -Name “PD-ImageServer” | Get-NTNXProtectionDomainSnapshot
Restore-NTNXEntity -Name $snap.protectionDomainName -SnapshotId $snap.snapshotId -VmNamePrefix “IMG_”
Creating the image
Now, a new VM is created on the destination cluster. From there, it is very simple to create the image within Acropolis. Just ssh to a Controller VM on the destination cluster.
- The following command will give you more information about the newly created VM.
acli vm.get IMG_ImageServer
Search for the vmdisk_uuid of the disk, and copy that.
- Now you have to create to image using:
acli image.create [Name of Image] clone_from_vmdisk=[vmdisk_uuid] image_type=kDiskImage
- After the successful creation of the image, you can delete the virtual machine using
acli vm.delete IMG_ImageServer
Updating the image
The update process of an image is very simple… Just recover a new version of the image from a snapshot, get the vmdisk_uuid and use the command:
acli image.update [Name of Image] clone_from_vmdisk=[vmdisk_uuid]
One last note
I had to find a way to distribute the reference images across the infrastructure. Most likely, other solutions for this task are available. If so, feel free to comment, so we can work together for the ultimate approach.