Nutanix: How to Create a New Storage Container with PHP
I recently had a need to create a new container in an existing Nutanix storage pool from a web interface. I did it using PHP. I figured since I wrote the code, which is very similar to the cloning script I posted here, I may as well post this as well.
The script itself is pretty self explanatory. Put your variables in the top, and the script posts the required data to the Nutanix REST API to create the new container.
One thing to note is that the API call to create a container requires you to include the UUID of the storage pool that you want the container created in. You can get this from the GUI, or programmatically via the REST API. In this example, I’ve just hard coded a Storage Pool UUID to show how it all works.