OpenStack Telemetry (Ceilometer)

CPU time & utilization polling fail with type mismatch on novaclient Server as opposed to the nova DB instance type

Reported by Eoghan Glynn on 2012-11-13
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Undecided
Unassigned

Bug Description

Previously the flavor vcpus used in the CPU util % metering was available from the nova DB instance representation.

Now that we retrieve the on-host instances from the public nova API as opposed to the DB, we need to retrieve and cache the flavor vcpus separately.

Similarly the treatment of the instance representation as a dict in log messages fails with:

2012-11-13 15:45:12 12980 DEBUG ceilometer.openstack.common.rpc.amqp [-] Making asynchronous cast on metering... cast /opt/ceilometer/ceilometer/openstack/common/rpc/amqp.py:377
2012-11-13 15:45:12 12980 DEBUG ceilometer.openstack.common.rpc.amqp [-] Making asynchronous cast on metering.disk.write.bytes... cast /opt/ceilometer/ceilometer/openstack/common/rpc/amqp.py:377
2012-11-13 15:45:12 12980 INFO ceilometer.compute.manager [-] polling libvirt_cpu
2012-11-13 15:45:12 12980 INFO ceilometer.compute.libvirt.cpu [-] checking instance 14e1c3b2-513f-4efe-8a89-71c2d4d49f90
2012-11-13 15:45:12 12980 ERROR ceilometer.compute.libvirt.cpu [-] could not get CPU time for 14e1c3b2-513f-4efe-8a89-71c2d4d49f90: 'Server' object is not iterable
2012-11-13 15:45:12 12980 ERROR ceilometer.compute.libvirt.cpu [-] 'Server' object is not iterable
2012-11-13 15:45:12 12980 TRACE ceilometer.compute.libvirt.cpu Traceback (most recent call last):
2012-11-13 15:45:12 12980 TRACE ceilometer.compute.libvirt.cpu File "/opt/ceilometer/ceilometer/compute/libvirt.py", line 179, in get_counters
2012-11-13 15:45:12 12980 TRACE ceilometer.compute.libvirt.cpu dict(instance), cpu_info['cpu_time'])
2012-11-13 15:45:12 12980 TRACE ceilometer.compute.libvirt.cpu TypeError: 'Server' object is not iterable

Reviewed: https://review.openstack.org/16012
Committed: http://github.com/openstack/ceilometer/commit/454c486e01b7782d5e01ed45dca00528865d929f
Submitter: Jenkins
Branch: master

commit 454c486e01b7782d5e01ed45dca00528865d929f
Author: Eoghan Glynn <email address hidden>
Date: Tue Nov 13 20:20:19 2012 +0000

    Determine instance cores from public flavors API

    Fixes bug 1078371

    Previously the flavor vcpus used in the CPU utilization metering
    was available from the nova DB instance representation.

    Now that we retrieve the on-host instances from the public nova API
    as opposed to the DB, we need to retrieve the flavor vcpus from
    the flavors API.

    Note that it's a known issue with nova that a flavor associated
    with a running instance can be deleted and re-created with the
    same ID but a different resource configuration (in this case, a
    different number of cores would led to an incorrect CPU util
    calculation). This will be addressed in a future nova patch.

    Change-Id: I093acb94a4818f671782a3cb4e2c846f29b8cec5

Changed in ceilometer:
status: New → Fix Committed
Thierry Carrez (ttx) on 2013-01-09
Changed in ceilometer:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-04-04
Changed in ceilometer:
milestone: grizzly-2 → 2013.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers