3

I'm trying to create a new Virtual Machine in VSphere via specifications entered into a web form POSTed to php. I found the method call CreateVM_Task (scroll 70% of the way down) which seems to be the right API call. My problem is how to connect the php to this API call. The documentation for VSphere is plentiful, but I'm having trouble getting what I need.

Ryan
  • 45
  • 1
  • 2
  • 10
  • What i've done before, is connect to the VSphere server via SSH and issue the commands via that, or another.. Less secure/suggested, is to have your PHP Script, upload a File to a directory on the server via `ftp_*`, then on the Vsphere server, have a running cron to read the file and act accordingly with the specified information – Daryl Gill Aug 07 '13 at 22:12

2 Answers2

2

why not try with Perl, its simple, vSphere SDK avail at free ,

http://www.vmware.com/support/developer/viperltoolkit/index.html

here they gave how to connect to vsphere, we can use web services calls to connect to vsphere. all the need is to open https port.

mpr4ul
  • 99
  • 1
2

The vSphere API is SOAP. You need to get the WSDL (download from VMware or get it directly from your vCenter) and use it to create a SOAP client.

Maybe this helps: Connecting to vSphere API via PHP5 using SOAP

Mario Lenz
  • 634
  • 3
  • 8