← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1240344] Re: Libvirt driver should reply with a meaningful exception, when connection to libvirt is broken

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1240344

Title:
  Libvirt driver should reply with a meaningful exception, when
  connection to libvirt is broken

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  Currently, when libvirt connection is broken, there is no meaningful exception being thrown. Instead, every call result in a mutlple traces, as below.
  This makes it imposible to handle these exceptions properly in the higher levels.

  2013-10-11 15:06:25.179 DEBUG nova.virt.libvirt.driver [req-cd22b4f2-0bfe-4d93-b191-02736ac8a437 None None] Connecting to libvirt: qemu:///system from (pid=28433) _get_connection /home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py:600
  2013-10-11 15:06:25.180 ERROR nova.virt.libvirt.driver [-] Connection to libvirt failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver Traceback (most recent call last):
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver   File "/home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py", line 694, in _connect
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver     return libvirt.openAuth(uri, auth, flags)
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 102, in openAuth
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver     if ret is None:raise libvirtError('virConnectOpenAuth() failed')
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
  2013-10-11 15:06:25.180 TRACE nova.virt.libvirt.driver 
  ----------------------------------------------------------------------------------------------------------
  2013-10-11 15:06:25.188 WARNING nova.virt.libvirt.driver [req-cd22b4f2-0bfe-4d93-b191-02736ac8a437 None None] URI qemu:///system does not support events
  Traceback (most recent call last):
    File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
  2013-10-11 15:06:25.190 ERROR nova.openstack.common.periodic_task [req-cd22b4f2-0bfe-4d93-b191-02736ac8a437 None None] Error during ComputeManager.update_available_resource: 'N
  oneType' object has no attribute 'getInfo'
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task Traceback (most recent call last):
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/openstack/common/periodic_task.py", line 180, in run_periodic_
  tasks
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     task(self, context)
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/compute/manager.py", line 4867, in update_available_resource
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     rt.update_available_resource(context)
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/openstack/common/lockutils.py", line 246, in inner
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     return f(*args, **kwargs)
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/compute/resource_tracker.py", line 274, in update_available_resource
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     resources = self.driver.get_available_resource(self.nodename)
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py", line 3744, in get_available_resource
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     stats = self.host_state.get_host_stats(refresh=True)
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py", line 4779, in get_host_stats
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     self.update_status()
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py", line 4813, in update_status
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     data["memory_mb"] = self.driver.get_memory_mb_total()
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task   File "/home/vladikr/devel/openstack/nova/nova/virt/libvirt/driver.py", line 3383, in get_memory_mb_total
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task     return self._conn.getInfo()[1]
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task AttributeError: 'NoneType' object has no attribute 'getInfo'
  2013-10-11 15:06:25.190 TRACE nova.openstack.common.periodic_task 
  q

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1240344/+subscriptions