Any actual Python libraries to work with VmWare VIX API?

3.5k Views Asked by At

Anybody here uses such a library? Or using ctypes with VIX API dll is enough for the task of managing VMWare images?

What do you think and what you can suggest based on your experience? Is there any active and up-to-date solution written in Python?

4

There are 4 best solutions below

2
On BEST ANSWER

It seems that pysphere, vix fit.

It's updated to the last version of VMware API, and it's been developed and maintainted for a while now.

Even though for really complex scripts you should use the official bindings for powershell: VMWare PowerCLI.

0
On

If your VirtualMachine objects are part of a vSphere environment you should use pyVmomi and use the GuestOperations. VIX has actually been deprecated from vSphere https://www.vmware.com/support/developer/vix-api/VIX-1.14-ReleaseNotes.html#Deprecate and should really only be used for Fusion or Workstation.

1
On

I'd recommend the official library released by VMware instead: pyVmomi. It mirrors the vSphere Web Services SDK and works in Python 2 or 3.

There's a discussion here: What is the Difference between PySphere and PyVmomi?

0
On

I used ctypesgen to generate a ctypes wrapper for the VIX dylib and wrote some helper classes (Host, VM, Job, etc.). I use it to revert VMs to named snapshots and run scripts in the guest.