ceilometer pollster for vmware maxsample can not match the type int

Bug #1330330 reported by heshang hua
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
sh.huang
Icehouse
Fix Released
Medium
Alan Pevec

Bug Description

The maxSample type :

 <Complex:0xc64aa90 name="PerfQuerySpec">
   <ComplexContent:0xc64add0>
      <Extension:0xc64ae90 ref="(u'DynamicData', u'urn:vim25')">
         <Sequence:0xcac5110>
            <Element:0xcac5790 name="dynamicType" type="(u'string', u'http://www.w3.org/2001/XMLSchema')" />
            <Element:0xcac5810 name="dynamicProperty" type="(u'DynamicProperty', u'urn:vim25')" />
         </Sequence>
         <Sequence:0xc64af50>
            <Element:0xc64c050 name="entity" type="(u'ManagedObjectReference', u'urn:vim25')" />
            <Element:0xc64c0d0 name="startTime" type="(u'dateTime', u'http://www.w3.org/2001/XMLSchema')" />
            <Element:0xc64c150 name="endTime" type="(u'dateTime', u'http://www.w3.org/2001/XMLSchema')" />
            <Element:0xc64c1d0 name="maxSample" type="(u'int', u'http://www.w3.org/2001/XMLSchema')" />
            <Element:0xc64c250 name="metricId" type="(u'PerfMetricId', u'urn:vim25')" />
            <Element:0xc64c2d0 name="intervalId" type="(u'int', u'http://www.w3.org/2001/XMLSchema')" />
            <Element:0xc64c350 name="format" type="(u'string', u'http://www.w3.org/2001/XMLSchema')" />
         </Sequence>
      </Extension>
   </ComplexContent>
</Complex>

The values:

(Content){
   tag = "querySpec"
   value =
      (PerfQuerySpec){
         dynamicType = None
         dynamicProperty[] = <empty>
         entity =
            (Property){
               value = "vm-289"
               _type = "VirtualMachine"
            }
         startTime = None
         endTime = None
         maxSample = 2.985542
         metricId[] =
            (PerfMetricId){
               dynamicType = None
               dynamicProperty[] = <empty>
               counterId = 148
               instance = "*"
            },
         intervalId = 20
         format = None
      }

The error:
<soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring>
Cannot parse &quot;2.985542&quot; as an int value

Revision history for this message
heshang hua (2863381314-h) wrote :

my solution

ceilometer/compute/virt/vmware/vsphere_operations.py
line 207
samples_cnt = (duration / VC_REAL_TIME_SAMPLING_INTERVAL if duration else 1)
->
samples_cnt = int(duration / VC_REAL_TIME_SAMPLING_INTERVAL if duration
                       else 1)

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

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

Changed in ceilometer:
assignee: nobody → sh.huang (sh-huang)
status: New → In Progress
Revision history for this message
sh.huang (sh-huang) wrote :

recheck bug 1330330

gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Medium
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/100441
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=2866266a5448b7c49ca8988f82f22b25192e6e16
Submitter: Jenkins
Branch: master

commit 2866266a5448b7c49ca8988f82f22b25192e6e16
Author: sh.huang <email address hidden>
Date: Tue Jun 17 08:37:36 2014 +0800

    Transform sample_cnt type to int

    Duration is seconds from current time, and sample_cnt on
    the basis of duration. So sample_cnt always not a int, but
    we need sample_cnt as a int type.

    Closes-Bug:#1330330

    Change-Id: I89e1768523384e24c3a0b8b76f4fa04a123248f9

Changed in ceilometer:
status: In Progress → Fix Committed
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-2 → 2014.2
tags: added: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/141412

Alan Pevec (apevec)
tags: removed: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/icehouse)

Reviewed: https://review.openstack.org/141412
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=bc9013bcf441c1a6e92f62a2cb2379d931b005b1
Submitter: Jenkins
Branch: stable/icehouse

commit bc9013bcf441c1a6e92f62a2cb2379d931b005b1
Author: sh.huang <email address hidden>
Date: Tue Jun 17 08:37:36 2014 +0800

    Transform sample_cnt type to int

    Duration is seconds from current time, and sample_cnt on
    the basis of duration. So sample_cnt always not a int, but
    we need sample_cnt as a int type.

    Closes-Bug:#1330330

    Change-Id: I89e1768523384e24c3a0b8b76f4fa04a123248f9
    (cherry picked from commit 2866266a5448b7c49ca8988f82f22b25192e6e16)

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.