VMware Cloud Community
snikers
Enthusiast
Enthusiast

vSphere and php

Hello to all vSphere community.

Has anybody succeded in controlling vSphere through php?

Is vmware going to create api for controlling vms through php?

Thanks

Tags (1)
0 Kudos
6 Replies
idle-jam
Immortal
Immortal

vSpere uses PowerCLI (based on powershell) to control and automate vSphere management. The nearest if could find is here controlling powershell via PHP @ http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/3881d0a3-9580-4d2f-a8ec-...

0 Kudos
DSTAVERT
Immortal
Immortal

You might want to have a look at http://blog.peacon.co.uk/wiki/Esxi-control.pl

While that is perl, it is using SOAP calls to ESX(i). The script is well documented so you could use it as a guide as you develop your php.

-- David -- VMware Communities Moderator
0 Kudos
lamw
Community Manager
Community Manager

To answer your question, no VMware does not have a vSphere PHP binding ... having said that, VMware does provide the actual WSDL in which you can use to generate a set of PHP bindings. User's have done this

Here are two examples of this and the latter actually someone created an non-VMware PHP binding for vSphere:

http://www.run-virtual.com/?page_id=125

https://github.com/nfabre/vmware-vsphere-api-php

Use at your own risk.

VMware does not have vSphere binding to PHP, but it does provide a PHP binding to their vCloud Director API - http://communities.vmware.com/community/developer/forums/vcloudsdkphp

You could take a look there to get ides on how they generated the stubs.

0 Kudos
snikers
Enthusiast
Enthusiast

Thank you for replies

As i understand there is no api for creating/pre-configuring VMs, starting and providing ready VM, only for similar operations such as start/stop and etc.

0 Kudos
mcowger
Immortal
Immortal

No there is an API - its a SOAP API.  Theres just no pre done bindings for PHP, so you'd eitherhave to create your own binding or send SOAP calls directly from PHP.

--Matt VCDX #52 blog.cowger.us
0 Kudos
lamw
Community Manager
Community Manager

Not sure what you mean by that, the vSphere API is pretty much parity complete with the things you can do using the vSphere Client minus a few tiny things. If you can do it using the vSphere Client, then you can automate it using the vSphere API. Which means you can create the PHP stubs to perform a specific operation in PHP

0 Kudos