What is the Difference between PySphere and PyVmomi?

anukalp picture anukalp · Jan 24, 2014 · Viewed 23.7k times · Source

I need to write python scripts to automate time configuration of Virtual Machines running on a ESX/ESXi host. I don't know which api to use... I am able to find to python bindings for VMWare apis viz. PySphere and PyVmomi. Could anyone please explain what is the difference between them, which one should be used?

Thanks!

Answer

joshk0 picture joshk0 · Jan 29, 2014

I'm the (now former) VMware employee who helped get this out the door.

pyVmomi represents the official bindings of the vSphere API released by VMware. The functions and object names map directly to what's documented in the vSphere Web Services SDK. It takes a while to get used to it and we should add some docs helping people map what's in the official documentation to what you can actually use in pyVmomi, but it's really all there and you'll probably get more functionality than you would out of pysphere which wraps official API calls in API-specific function names.

One of the most complete projects that uses the vSphere API via pyVmomi is another project I helped open source, ThinApp Factory. I recommend looking at its source (specifically linked.py) to see what is possible.

If things are hard to use or unclear about pyVmomi, please feel free to file a bug on our Github. Have fun!