Actually, openstack just write some wrappers around libvirt api,
together with some logic related to openstack itself.
def _lookup_by_name(self, instance_name):
"""Retrieve libvirt domain object given an instance name.
All libvirt error handling should be handled in this method
relevant nova exceptions should be raised in response.
except libvirt.libvirtError as ex:
error_code = ex.get_error_code()
if error_code == libvirt.VIR_ERR_NO_DOMAIN:
msg = _("Error from libvirt while looking up
"[Error Code %(error_code)s] %(ex)s") % locals()
self._conn is libvirt connection.
By the way, openstack support multiple virtualization drivers,
libvirt is only one of them.
I think you can treat openstack libvirt api as a reference, then
modify libvirt api to suite your needs.
On 11/12/2012 10:07 AM, 宣铭艺 wrote:
And another question : is openstack libvirt-python rewrited by
here is the openstack libvirt-python doc:
If you install openstack with devstack by default.
You can find the lib in /opt/stack/nova/nova/virt/libvirt
It has these files,but not one file named libvirt.py
root c65:/opt/stack/nova/nova/virt/libvirt# ls *.py
config.py imagebackend.py snapshots.py volume_nfs.py
driver.py imagecache.py utils.py volume.py
firewall.py __init__.py vif.py
I think I may use it.
2012/11/12 Xiao Hanyu <hanyu xiao eayun com>
Matbe there's no libvirt python api document. You can lookup
the api directly from the libvirt.py file.
In my machine, libvirt.py is located at
And, you can lookup the ruby api and c api for a reference,
most of them are the same name.
On 11/12/2012 09:34 AM, 宣铭艺 wrote:
libvirt-users mailing list
libvirt-users redhat com