Oh, I see! There is also this KB AHV: Ubuntu Cloud Image VM creation option 2 of which goes through creating and configuring a VM via REST API call through Prism Central using curl.
Hi justinl123,
Have you seen this post? Was it helpful or is it not what you’re looking for?
Hey Alona,
Kind of. I want to programmatically create a VM with name XYZ and also put that name XYZ in the hostname: field of your Custom Script (i.e. cloud-init). That way, we can call the script, say 10 times and increment the hostname i.e. XYZ01, XYZ02, XYZ03, … and the VM will be named appropriately, as well as the guest hostname.
That way we can stamp out n number of VMs in one go, by running one script passing in a hostname prefix.
This is more along the lines of what I want to do, but without the Calm integration. When I get a chance, I’ll look at scripting a REST API call that also builds, and base64 encodes the cloud-init ‘user data’ portion with matching hostnames.
Ah yep, exactly that with a wrapper script around it to automate the steps, accepting a parameter for hostname!
Many Thanks!
Great! Glad that was helpful :)