Question

Distribute template VM's as qcow2 images globally using Prism Central image management

  • 22 November 2019
  • 3 replies
  • 2341 views

Badge

We normally keep a handful of template VM’s with different type of OS that are updated and “ready to go” and use these for global automation when deploying new machines. I would like a way to deploy these templates as qcow2 images globally using the Prism Central image management. After a template VM are updated, I would like to automate them beeing converted to qcow2 images (already got this working with “qemu-img convert” command) and then import the qcow2 image to the Image repository in Prism Central to be distributed to all sites. The last step I have not managed to figure out how to do. Obviously I need some kind of API or CLI to automate this but all I find is how to do this using the GUI in PC. Did I miss something? 


3 replies

Userlevel 3
Badge +4

Hi @Tedevil 

To clarify some points from your question:

1 - the hypervisor on your cluster is AHV?

2 - Do you create the master image / vm on the same cluster?

 

After a template VM are updated, I would like to automate them beeing converted to qcow2 images (already got this working with “qemu-img convert” command) and then import the qcow2 image to the Image repository in Prism Central to be distributed to all sites 

 

Per above, are you using any other hypervisor / platform to build these images? 

if the cluster hypervisor is AHV and you are creating these VMs on the same cluster, You can use acli to convert a vdisk to a image and it will be published in the image repository for deploying other virtual machines.

BR

 

 

Badge

This is planned for only AHV clusters. The image managment in PC only support AHV. The template sits on a AHV cluster. I seen the “acli image.create" command on the CVM but this would only create the image on the local PE right? How would you suggest this image is added to the image management on PC?

Userlevel 3
Badge +4

This is planned for only AHV clusters. The image managment in PC only support AHV. The template sits on a AHV cluster. I seen the “acli image.create" command on the CVM but this would only create the image on the local PE right? How would you suggest this image is added to the image management on PC?

@Tedevil  Thank you for your reply.

Once you have created an image of an existing VM via acli on the cluster, you can import those images on Prism Central via : 

PC > Virtual Infrastructure > Images > Import Images

You can read about creating images via acli at:

https://next.nutanix.com/prism-infrastructure-management-26/ahv-vdisk-part-3-creating-an-image-of-or-from-an-existing-vdisk-33686

How to make Image from VM disk

Hope this helps

BR

Reply