On Wed, Nov 04, 2009 at 12:45:06PM +0100, Matthias Bolte wrote:
2009/11/3 Dave Bryson <daveb(a)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.
Feel free to add it as well as your explanations in examples/python/
and examples/python/README :-)
thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/