Divide by zero can occur when querying non-active VM

Bug #1492831 reported by Drew Thorstensen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceilometer-powervm
Fix Released
Undecided
Unassigned

Bug Description

 [-] float division by zero
 Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/powervc_nova/virt/ibmpowervm/pvm/driver.py", line 488, in monitor_instances
     instance_obj, duration=None)
   File "/usr/lib/python2.7/dist-packages/ceilometer_powervm/compute/virt/powervm/inspector.py", line 199, in inspect_cpu_util
     util = float(util_cap + util_uncap - idle - donated) / float(entitled)
 ZeroDivisionError: float division by zero

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer-powervm (master)

Reviewed: https://review.openstack.org/220843
Committed: https://git.openstack.org/cgit/stackforge/ceilometer-powervm/commit/?id=1885f85438b38a952cbf0313ff079d18e50809e8
Submitter: Jenkins
Branch: master

commit 1885f85438b38a952cbf0313ff079d18e50809e8
Author: Drew Thorstensen <email address hidden>
Date: Sun Sep 6 15:48:13 2015 -0400

    Handle unstarted instances

    In the rare event that a VM is queried for CPU utilization before its
    first boot, the entitled cycles may be 0. This resulted in a divide by
    zero error. This change detects that scenario and removes the divide by
    zero possibility.

    Change-Id: If37422e7b501c60ad2b1cb610b8c7802e6543942
    Closes-Bug: 1492831

Changed in ceilometer-powervm:
status: New → Fix Committed
Changed in ceilometer-powervm:
status: Fix Committed → Fix Released
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.