vmware – Create VM by REST API without vCenter

vmware – Create VM by REST API without vCenter

VMs can be created through either the vSphere Client or the vSphere Management API. There is no requirement to install a vCenter server.

Example to create VMs through the vSphere Client: https://www.youtube.com/watch?v=ddUs5FsczzY

Example to create VMs through the open sourced pyvmomi SDK: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/create_random_marvel_vms.py

Example to create a VM through the open sourced rbvmomi SDK: https://code.vmware.com/samples/781/create-vm?h=vm%20create

This can be done through several other SDKs as well with the usage of the CreateVM_Task method.

Additional information about this method is available here: http://pubs.vmware.com/vsphere-6-5/index.jsp?topic=/com.vmware.wssdk.apiref.doc/index.html&single=true

Then select All Methods and search for CreateVM_Task

Creating a VM should be fine with ESXi server directly, but you cannot clone an existing VM or template. The vSphere APIs can do that by connecting to your ESXi directly.

If you really want REST APIs, you can try a 3rd party: https://github.com/DoubleCloudInc/vim-rest-api/ (disclaimer: I am the author).

vmware – Create VM by REST API without vCenter

Leave a Reply

Your email address will not be published.