Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

Fixed the error : Unable to load the virtualization driver: No module named libvirt

Fix-1

#

sudo apt-get install python-libvirt Update .venv/lib/python2.7/site-packages/easy-install.pth

But, after that when running ./bin/nova-all getting following erros

Error : when running ./bin/nova-compute OR ./bin/nova-all

(.venv)saju@saju-desktop:~/openstk_manual/nova$ ./bin/nova-compute 2013-03-26 16:34:21 25350 INFO nova.compute.manager [-] Loading compute driver 'nova.virt.connection.get_connection' 2013-03-26 16:34:21 25350 WARNING nova.common.deprecated [-] Deprecated Config: Specifying virt driver via connection_type is deprecated. Use compute_driver=classname instead. 2013-03-26 16:34:21 25350 AUDIT nova.service [-] Starting compute node (version 2012.2.4-LOCALBRANCH:LOCALREVISION) libvir: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory Traceback (most recent call last): File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in fire_timers timer() File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 56, in __call__ cb(args, kw) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/event.py", line 163, in _do_send waiter.switch(result) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main result = function(args, *kwargs) File "/home/saju/openstk_manual/nova/nova/service.py", line 132, in run_server server.start() File "/home/saju/openstk_manual/nova/nova/service.py", line 398, in start self.manager.init_host() File "/home/saju/openstk_manual/nova/nova/compute/manager.py", line 268, in init_host self.driver.init_host(host=self.host) File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 333, in init_host if not self.has_min_version(MIN_LIBVIRT_VERSION): File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 322, in has_min_version libvirt_version = self._conn.getLibVersion() File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 350, in _get_connection self._connect, self.uri, self.read_only) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/tpool.py", line 147, in proxy_call rv = execute(f,args,kwargs) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/tpool.py", line 76, in tworker rv = meth(args,*kwargs) File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 404, in _connect return libvirt.openAuth(uri, auth, 0) File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory 2013-03-26 16:34:21 25350 CRITICAL nova [-] Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory (.venv)saju@saju-desktop:~/openstk_manual/nova

I also fixed the error: Failed to connect socket to '/var/run/libvirt/libvirt-sock':, with following steps

Fix-2

#

a) Install libvirt-1.0 from tarball http://fosshelp.blogspot.in/2013/03/how-to-compile-and-install-libvirt-100.html

b) Run libvirtd deamon as root

su - root

libvirtd -d

c) Run ./bin/nova-all OR ./bin/nova-compute

The commands "nova-all" and "nova-compute" are prompted for sudo password and failed with following error

(.venv)saju@saju-desktop:~/openstk_manual/nova$ ./bin/nova-compute 2013-03-26 18:36:12 5878 INFO nova.compute.manager [-] Loading compute driver 'nova.virt.connection.get_connection' 2013-03-26 18:36:12 5878 WARNING nova.common.deprecated [-] Deprecated Config: Specifying virt driver via connection_type is deprecated. Use compute_driver=classname instead. 2013-03-26 18:36:13 5878 AUDIT nova.service [-] Starting compute node (version 2012.2.4-LOCALBRANCH:LOCALREVISION) Traceback (most recent call last): File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in fire_timers timer() File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 56, in __call__ cb(args, *kw) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/event.py", line 163, in _do_send waiter.switch(result) File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main result = function(args, *kwargs) File "/home/saju/openstk_manual/nova/nova/service.py", line 132, in run_server server.start() File "/home/saju/openstk_manual/nova/nova/service.py", line 410, in start self.manager.update_available_resource(ctxt) File "/home/saju/openstk_manual/nova/nova/compute/manager.py", line 2845, in update_available_resource self.resource_tracker.update_available_resource(context) File "/home/saju/openstk_manual/nova/nova/utils.py", line 804, in inner retval = f(args, *kwargs) File "/home/saju/openstk_manual/nova/nova/compute/resource_tracker.py", line 390, in update_available_resource resources = self.driver.get_available_resource() File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 2250, in get_available_resource 'local_gb': self.get_local_gb_total(), File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 2044, in get_local_gb_total stats = libvirt_utils.get_fs_info(FLAGS.instances_path) File "/home/saju/openstk_manual/nova/nova/virt/libvirt/utils.py", line 429, in get_fs_info hddinfo = os.statvfs(path) OSError: [Errno 2] No such file or directory: '/home/saju/openstk_manual/nova/instances' 2013-03-26 18:36:17 5878 CRITICAL nova [-] [Errno 2] No such file or directory: '/home/saju/openstk_manual/nova/instances' (.venv)saju@saju-desktop:~/openstk_manual/nova$

Hi,

Fixed the error : Unable to load the virtualization driver: No module named libvirt

Fix-1

#

sudo apt-get install python-libvirt
Update .venv/lib/python2.7/site-packages/easy-install.pth

.venv/lib/python2.7/site-packages/easy-install.pth

But, after that when running ./bin/nova-all getting following erros

Error : when running ./bin/nova-compute OR ./bin/nova-all

(.venv)saju@saju-desktop:~/openstk_manual/nova$ ./bin/nova-compute
2013-03-26 16:34:21 25350 INFO nova.compute.manager [-] Loading compute driver 'nova.virt.connection.get_connection'
2013-03-26 16:34:21 25350 WARNING nova.common.deprecated [-] Deprecated Config: Specifying virt driver via connection_type is deprecated. Use compute_driver=classname instead.
2013-03-26 16:34:21 25350 AUDIT nova.service [-] Starting compute node (version 2012.2.4-LOCALBRANCH:LOCALREVISION)
libvir: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
Traceback (most recent call last):
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in fire_timers
    timer()
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 56, in __call__
    cb(args, kw)
cb(*args, **kw)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/event.py", line 163, in _do_send
    waiter.switch(result)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main
    result = function(args, *kwargs)
function(*args, **kwargs)
  File "/home/saju/openstk_manual/nova/nova/service.py", line 132, in run_server
    server.start()
  File "/home/saju/openstk_manual/nova/nova/service.py", line 398, in start
    self.manager.init_host()
  File "/home/saju/openstk_manual/nova/nova/compute/manager.py", line 268, in init_host
    self.driver.init_host(host=self.host)
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 333, in init_host
    if not self.has_min_version(MIN_LIBVIRT_VERSION):
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 322, in has_min_version
    libvirt_version = self._conn.getLibVersion()
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 350, in _get_connection
    self._connect, self.uri, self.read_only)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/tpool.py", line 147, in proxy_call
    rv = execute(f,args,kwargs)
execute(f,*args,**kwargs)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/tpool.py", line 76, in tworker
    rv = meth(args,*kwargs)
meth(*args,**kwargs)
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 404, in _connect
    return libvirt.openAuth(uri, auth, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
2013-03-26 16:34:21 25350 CRITICAL nova [-] Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
(.venv)saju@saju-desktop:~/openstk_manual/nova

(.venv)saju@saju-desktop:~/openstk_manual/nova

I also fixed the error: Failed to connect socket to '/var/run/libvirt/libvirt-sock':, '/var/run/libvirt/libvirt-sock':, with following steps

Fix-2

#

a)

  • Install libvirt-1.0 from tarball http://fosshelp.blogspot.in/2013/03/how-to-compile-and-install-libvirt-100.html

    b) tarball instructions

  • Run libvirtd deamon as root

    su - root

    libvirtd -d

c) Run ./bin/nova-all ./bin/nova-all OR ./bin/nova-compute

The commands "nova-all" and "nova-compute" are prompted for sudo password and failed with following error

(.venv)saju@saju-desktop:~/openstk_manual/nova$ ./bin/nova-compute
2013-03-26 18:36:12 5878 INFO nova.compute.manager [-] Loading compute driver 'nova.virt.connection.get_connection'
2013-03-26 18:36:12 5878 WARNING nova.common.deprecated [-] Deprecated Config: Specifying virt driver via connection_type is deprecated. Use compute_driver=classname instead.
2013-03-26 18:36:13 5878 AUDIT nova.service [-] Starting compute node (version 2012.2.4-LOCALBRANCH:LOCALREVISION)
Traceback (most recent call last):
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in fire_timers
    timer()
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 56, in __call__
    cb(args, *kw)
cb(*args, **kw)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/event.py", line 163, in _do_send
    waiter.switch(result)
  File "/home/saju/openstk_manual/nova/.venv/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main
    result = function(args, *kwargs)
function(*args, **kwargs)
  File "/home/saju/openstk_manual/nova/nova/service.py", line 132, in run_server
    server.start()
  File "/home/saju/openstk_manual/nova/nova/service.py", line 410, in start
    self.manager.update_available_resource(ctxt)
  File "/home/saju/openstk_manual/nova/nova/compute/manager.py", line 2845, in update_available_resource
    self.resource_tracker.update_available_resource(context)
  File "/home/saju/openstk_manual/nova/nova/utils.py", line 804, in inner
    retval = f(args, *kwargs)
f(*args, **kwargs)
  File "/home/saju/openstk_manual/nova/nova/compute/resource_tracker.py", line 390, in update_available_resource
    resources = self.driver.get_available_resource()
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 2250, in get_available_resource
    'local_gb': self.get_local_gb_total(),
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/driver.py", line 2044, in get_local_gb_total
    stats = libvirt_utils.get_fs_info(FLAGS.instances_path)
  File "/home/saju/openstk_manual/nova/nova/virt/libvirt/utils.py", line 429, in get_fs_info
    hddinfo = os.statvfs(path)
OSError: [Errno 2] No such file or directory: '/home/saju/openstk_manual/nova/instances'
2013-03-26 18:36:17 5878 CRITICAL nova [-] [Errno 2] No such file or directory: '/home/saju/openstk_manual/nova/instances'
(.venv)saju@saju-desktop:~/openstk_manual/nova$ 

(.venv)saju@saju-desktop:~/openstk_manual/nova$