[libvirt] ESX with Python binding

Matthias Bolte matthias.bolte at googlemail.com
Wed Nov 4 11:45:06 UTC 2009

2009/11/3 Dave Bryson <daveb at miceda.org>:
> I'm new to libvirt.  Is it possible to use the python binding with the
> latest ESX support? If so, does anyone have a simple example I can try?
> Thanks in advance!
> Dave

Yes, just use the libvirt Python bindings as you would with Xen or
QEmu. There are some basic examples in the examples/python directory.
The tricky part is the authentication. None of the available examples
demonstrates how to use the authentication callback with the
openAuth() method in Python. So I took one of the existing example
scripts and switched it from openReadOnly() to openAuth().

python esxlist.py <esx-hostname>

It'll prompt for username and password and then list all active
virtual machines on this ESX server.

You may see remote errors complaining about missing certificates:

  Cannot access CA certificate '/usr/local/etc/pki/CA/cacert.pem': No
such file or directory

This is expected, libvirt tries to find network and storage drivers
for ESX, but those are not implemented yet. While searching for this
drivers, libvirt may try to start a local libvirtd instance, but fails
because of the missing certificates. It'll warn about that:

  Failed to find the network: Is the daemon running?

This is also expected and can be ignored.

PS: There is currently no user documentation on the libvirt website
about the ESX support. It's on my todo list to write such
documentation soon. So feel free to ask questions.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: esxlist.py
Type: text/x-python
Size: 3179 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20091104/adfd4fcf/attachment-0001.py>

More information about the libvir-list mailing list