We just got a lab Nutanix cluster purchased and I'm working on playing around with the Nutanix Prism Central API v3. I'm using Ansible to make calls to the API.
I'm sure this has been done many times before, so I want to make sure I'm not going about it incorrectly or illogically. I have an Ansible play written that created a new VM, uses an image I provide, and can add disks based on survey input through Ansible. It automatically powers on and comes online with an IP from the pool we have set up in Nutanix.
My question is, once I have this VM created, what's the best way to go about customizing the OS? The Ansible play is actually running locally on my Ansible Tower instance and making a uri call over to Prism Central's API. I'm not connected to the new VM that was created because it didn't exist when I first ran the play. In order to connect to it, I would have to get the IP from Nutanix somehow and then add it into the inventory.
I'm wondering if maybe I should be using a cloud-init script instead and can pass that in through the guest_customization parameter in the API during VM creation? I haven't played around with cloud-init at all yet, so maybe that's not the way to go.
Any suggestions on how to go about the OS customization once the VM is built? High level logical steps are what I'm looking for at this point.