"diagnostics" not working for libvirt driver

Bug #1076527 reported by Christian Berendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Christian Berendt

Bug Description

Looks like "nova diagnostics ID" is not working when using libvirt as driver (with Xen as hypervisor) on nova-compute. I received the following error.

In the code is also an hint that it's maybe not working:

---snip---
        # memoryStats might launch an exception if the method
        # is not supported by the underlying hypervisor being
        # used by libvirt
---snap---

I think there should be place some exception handling...

2012-11-08 20:21:06 AUDIT nova.compute.manager [req-57acccff-f970-47c0-9c8a-6befb4f3fc9e 5d795ef6a803425e902922bb8f817828 5536f9774f2f42f4a5d4bbc47a484ae8] [instance: f781c989-0b7e-4311-9133-7fdc933b60e5] Retrieving diagnostics
2012-11-08 20:21:06 ERROR nova.openstack.common.rpc.amqp [-] Exception during message handling
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/openstack/common/rpc/amqp.py", line 275, in _process_data
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/exception.py", line 117, in wrapped
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/exception.py", line 92, in wrapped
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/compute/manager.py", line 202, in decorated_function
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp kwargs['instance']['uuid'], e, sys.exc_info())
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/compute/manager.py", line 196, in decorated_function
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/compute/manager.py", line 1786, in get_diagnostics
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp return self.driver.get_diagnostics(instance)
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2985, in get_diagnostics
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp for key in mem.keys():
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp AttributeError: 'NoneType' object has no attribute 'keys'
2012-11-08 20:21:06 TRACE nova.openstack.common.rpc.amqp
2012-11-08 20:21:06 ERROR nova.openstack.common.rpc.common [-] Returning exception 'NoneType' object has no attribute 'keys' to caller

Revision history for this message
Christian Berendt (berendt) wrote :

exception handling has to be more generic to also fetch the AttributeError. I'll commit a bugfix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/15662

Changed in nova:
assignee: nobody → Christian Berendt (berendt)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/15662
Committed: http://github.com/openstack/nova/commit/0406d1f85fa93db4e4d5ab8b37d298951d4c4193
Submitter: Jenkins
Branch: master

commit 0406d1f85fa93db4e4d5ab8b37d298951d4c4193
Author: Christian Berendt <email address hidden>
Date: Thu Nov 8 20:41:07 2012 +0100

    make diagnostics workable for libvirt with Xen

    When using "diagnostics" with libvirt as driver on nova-compute
    and Xen as hypervisor the call to domain.memoryStats() in
    get_diagnostics() doesn't fail with a libvirt.libvirtError,
    but with an AttributeError. This exception should be catched, too.

    The method virDomainMemoryStats is not implemented in libvirt
    for Xen.

    fixes bug 1076527

    Change-Id: I16645654b346e3c40ff3dd63f20600c802cbeb3f

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.