Metrics filter receives wrong metric value

Bug #1514997 reported by Surojit Pathak
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Surojit Pathak

Bug Description

With the following turned on in the config, /etc/nova/nova.conf
 + compute_monitors = virt_driver
 + scheduler_default_filters = MetricsFilter

nova/scheduler/filters/metrics_filter.py: MetricsFilter does not work as intended, as it gets wrong metrics values to work on, even when the data on DB is correct.

Snippet from DB -
http://paste.openstack.org/show/478481/

While printing the metrics name and value in the filter, the output shows that all the CPU metrics, computed as percentage, were received as 0.

Snippet -
cpu.user.percent 0
cpu.kernel.time 580491900000000
cpu.kernel.percent 0
cpu.idle.time 8440469190000000
cpu.idle.percent 0
cpu.iowait.time 264054730000000
cpu.percent 0
cpu.user.time 2539292510000000
cpu.frequency 2400
cpu.iowait.percent 0

Changed in nova:
assignee: nobody → Surojit Pathak (suro-patz)
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/243825

Changed in nova:
status: New → In Progress
Revision history for this message
Surojit Pathak (suro-patz) wrote :

The detail of the nova version, on which the issue was observed -

[suro@oxy-dev nova (master)]$ pwd
/opt/stack/nova
[suro@oxy-dev nova (master)]$ git log -1
commit 4474dce9e6b847a7691fc3f01d0c594061570d73
Merge: b12e72f 768388d
Author: Jenkins <email address hidden>
Date: Mon Nov 9 06:04:10 2015 +0000

    Merge "devref: update the nova architecture doc"
[suro@oxy-dev nova (master)]$

melanie witt (melwitt)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/243825
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ddb3c4e26f3a908de7836a8fac48360afa6aa1d7
Submitter: Jenkins
Branch: master

commit ddb3c4e26f3a908de7836a8fac48360afa6aa1d7
Author: Surojit Pathak <email address hidden>
Date: Wed Nov 25 19:21:24 2015 +0000

    Fix wrong CPU metric value in metrics_filter

    CPU metrics are reported as a normalized value in [0,1].
    When scheduler reads the data as MonitorMetric object, as part
    of update_from_compute_node(), the value of the metric gets
    lost due to a wrong type conversion, typecasting into an Integer,
    reduces it to 0.

    Note:
     - It may seem unintuitive that to fix the same, we are not changing
       the type of metric from Integer to Float. Please refer the
       discussions -
       * https://review.openstack.org/#/c/243825/
       * https://review.openstack.org/#/c/216923/
     - To summarize, we are trying to save some 'possible' downstream consumer
       of metrics updates from compute nodes, i.e. consuming from AMPQ, from
       software upgrade scenarios.

    Change-Id: Ib504af33e05dfc4d7e97b52682e27befc67d784a
    Closes-bug: #1514997

Changed in nova:
status: In Progress → Fix Released
Ryan Rossiter (rlrossit)
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/300134

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/liberty)

Reviewed: https://review.openstack.org/300134
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c0dfe42382262f044471d0a852c6b724e8e81ad8
Submitter: Jenkins
Branch: stable/liberty

commit c0dfe42382262f044471d0a852c6b724e8e81ad8
Author: Surojit Pathak <email address hidden>
Date: Wed Nov 25 19:21:24 2015 +0000

    Fix wrong CPU metric value in metrics_filter

    CPU metrics are reported as a normalized value in [0,1].
    When scheduler reads the data as MonitorMetric object, as part
    of update_from_compute_node(), the value of the metric gets
    lost due to a wrong type conversion, typecasting into an Integer,
    reduces it to 0.

    Note:
     - It may seem unintuitive that to fix the same, we are not changing
       the type of metric from Integer to Float. Please refer the
       discussions -
       * https://review.openstack.org/#/c/243825/
       * https://review.openstack.org/#/c/216923/
     - To summarize, we are trying to save some 'possible' downstream consumer
       of metrics updates from compute nodes, i.e. consuming from AMPQ, from
       software upgrade scenarios.

    Change-Id: Ib504af33e05dfc4d7e97b52682e27befc67d784a
    Closes-bug: #1514997
    (cherry picked from commit ddb3c4e26f3a908de7836a8fac48360afa6aa1d7)

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 12.0.4

This issue was fixed in the openstack/nova 12.0.4 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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