Menu Close

Bulk creation of Virtual Machines on Nutanix

The bulk creation of Virtual Machines (VMs) on the Nutanix AHV Platform may be implemented via automation by using Nutanix’ Prism Central REST API. As there were no ansible modules available for provisioning virtual machines on Nutanix, you may use the ansible builtin uri module along with the REST API to automate VM creation.

I’ve created an ansible role called cybergavin.nutanix_vm_create to enable users to accept a CSV containing specifications of VMs (e.g. name, IP address) and provision those VMs. This role was influenced by another role mbach04.nutanix_vm_provisioner.

Refer the “Read Me” for the ansible role or my GitHub Repo for the role for more details.

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Print Friendly, PDF & Email

2 Comments

  1. Marty Hillman

    Thanks for the awesome work. Too bad things are constantly changing with Ansible and Nutanix APIs. The roles no longer seem to work due to issues with JSON.

    TASK [Store the cluster names/UUIDs] ************************************************************************
    fatal: [localhost]: FAILED! => {“msg”: “‘dict object’ has no attribute ‘json’. ‘dict object’ has no attribute ‘json'”}

    It is the same issue for cluster UUIDs, image UUIDs and subnet UUIDs. At least I am a step closer to getting Ansible to work to provision VMs, but for now, Terraform is the only thing that seems to function properly other than manually performing the owrk through Prism Central.

  2. cybergavin

    Marty, thank you for your feedback. It will help other readers. Yes, any change with Nutanix APIs will break this Ansible role. I no longer have access to a Nutanix platform to maintain the role. If the Terraform Nutanix provider works for your requirements, then that declarative IaC model would be preferred. All the best!

Leave a Reply

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