Bug 1546176

Summary: Missing metadata in libvirt xml causes ceilometer-compute to crash
Product: Red Hat OpenStack Reporter: Lars Kellogg-Stedman <lars>
Component: openstack-ceilometerAssignee: Mehdi ABAAKOUK <mabaakou>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: medium Docs Contact:
Priority: medium    
Version: 12.0 (Pike)CC: jamsmith, jruzicka, mabaakou, pkilambi, srevivo
Target Milestone: z3Keywords: Triaged, ZStream
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-ceilometer-9.0.5-1.el7ost Doc Type: No Doc Update
Doc Text:
-
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-20 12:54:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lars Kellogg-Stedman 2018-02-16 14:14:33 UTC
Description of problem:

I am working with an environment in which some nova instances are missing the "<nova:owner>" attribute in the embedded metadata in the domain xml. For example:

  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="14.0.3-9.el7ost"/>
      <nova:name>wm-solr</nova:name>
      <nova:creationTime>2017-05-24 15:29:24</nova:creationTime>
      <nova:flavor name="m1.large">
        <nova:memory>8192</nova:memory>
        <nova:disk>80</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>4</nova:vcpus>
      </nova:flavor>
      <nova:owner/>
      <nova:root type="image" uuid="a332ad63-8b38-4700-b818-b39fa69233a9"/>
    </nova:instance>
  </metadata>

This results in discover_libvirt_polling in ceilometer/compute/discovery throwing an AttributeError traceback when it tries to access:

  user_id = metadata_xml.find("./owner/user").attrib["uuid"]

This means that it will fail to poll any subsequent libvirt guests, which means the loss of many metrics.

Version-Release number of selected component (if applicable):

openstack-ceilometer-compute-9.0.3-1.el7ost.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Lars Kellogg-Stedman 2018-02-16 14:15:35 UTC
I opened https://bugs.launchpad.net/ceilometer/+bug/1749960 upstream and submitted a fix, https://review.openstack.org/#/c/545303/.

Comment 2 Lars Kellogg-Stedman 2018-02-16 14:16:02 UTC
There is a related bug filed against Nova, https://bugzilla.redhat.com/show_bug.cgi?id=1546168.

Comment 9 Sasha Smolyak 2018-08-19 07:57:06 UTC
The missing metadata is handled, the patch is in the version. Fixed

Comment 11 errata-xmlrpc 2018-08-20 12:54:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2522