Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1103490 - [REST API]: Missing VM statistics field.
[REST API]: Missing VM statistics field.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.5.0
Unspecified Unspecified
unspecified Severity high
: ---
: 3.5.0
Assigned To: Tomas Jelinek
Ilanit Stein
virt
: AutomationBlocker, Regression, Triaged
Depends On:
Blocks: rhev3.5beta 1156165
  Show dependency treegraph
 
Reported: 2014-06-01 09:24 EDT by Ilanit Stein
Modified: 2015-02-12 02:56 EST (History)
14 users (show)

See Also:
Fixed In Version: ovirt-3.5.0-alpha2
Doc Type: Bug Fix
Doc Text:
An exception was thrown when the virtual machine statistics was accessed using the REST API, and it was not possible to retrieve the statistics. With this update, users can now access the statistics using the REST API.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-11 13:02:43 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 28342 master MERGED restapi: fix NPE on vm statistics Never
Red Hat Product Errata RHSA-2015:0158 normal SHIPPED_LIVE Important: Red Hat Enterprise Virtualization Manager 3.5.0 2015-02-11 17:38:50 EST

  None (edit)
Description Ilanit Stein 2014-06-01 09:24:24 EDT
Description of problem:

Automatic test on CI fail on GET VM statistics:

request content is --  url:/ovirt-engine/api/vms/ac65d66b-18b0-4289-8ba1-3dd0e40e7a1e/statistics 
2014-05-29 19:03:41,156 - MainThread - vms - ERROR - Response code is not valid, expected is: [200, 201], actual is: 500 

Jenkins job:
http://jenkins-ci.eng.lab.tlv.redhat.com/view/0%20Unstable%203.5/job/rhevm_3.5_automation_coretools_two_hosts_restapi_vms_nfs_rest_factory/127/
 
Version-Release number of selected component (if applicable):
rhevm-3.5.0-0.1000.1552.4bf744d.master.el6ev.noarch.rpm

How reproducible:
100%
Comment 1 Juan Hernández 2014-06-03 14:08:46 EDT
This happens because we don't check if the migration progress value returned by the backend is null, just call the "setDatum" method. Before that call the JVM will try to unbox the value and thus generate a NPE.
Comment 3 Ilanit Stein 2014-08-07 04:27:06 EDT
Verified on rhevm-3.5,
on the same test.
last commit (origin/master): 541546ecbbe5d1465c17aea03b8b75ed8b87dfbb 

http://jenkins-ci.eng.lab.tlv.redhat.com/view/0%20Unstable%203.5/job/rhevm_3.5_automation_coretools_two_hosts_restapi_vms_nfs_rest_factory/380/

2014-08-06 19:20:11,373 - MainThread - vms - DEBUG - GET request content is --  url:/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics 
2014-08-06 19:20:11,641 - MainThread - vms - DEBUG - Response code is valid: [200, 201] 
2014-08-06 19:20:11,673 - MainThread - vms - DEBUG - Response body for GET request is: 
<statistics>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/5a89a1d2-32be-33f7-a0d1-f8b5bc974ff6" id="5a89a1d2-32be-33f7-a0d1-f8b5bc974ff6">
        <name>memory.installed</name>
        <description>Total memory configured</description>
        <values type="INTEGER">
            <value>
                <datum>1073741824</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>BYTES</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/b7499508-c1c3-32f0-8174-c1783e57bb08" id="b7499508-c1c3-32f0-8174-c1783e57bb08">
        <name>memory.used</name>
        <description>Memory used (agent)</description>
        <values type="INTEGER">
            <value>
                <datum>0</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>BYTES</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/ef802239-b74a-329f-9955-be8fea6b50a4" id="ef802239-b74a-329f-9955-be8fea6b50a4">
        <name>cpu.current.guest</name>
        <description>CPU used by guest</description>
        <values type="DECIMAL">
            <value>
                <datum>0</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>PERCENT</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/d849a55f-0049-36f8-ae65-face541473ac" id="d849a55f-0049-36f8-ae65-face541473ac">
        <name>cpu.current.hypervisor</name>
        <description>CPU overhead</description>
        <values type="DECIMAL">
            <value>
                <datum>0</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>PERCENT</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/2ec286fe-4bec-32f5-8d63-dba7bed58763" id="2ec286fe-4bec-32f5-8d63-dba7bed58763">
        <name>cpu.current.total</name>
        <description>Total CPU used</description>
        <values type="DECIMAL">
            <value>
                <datum>0</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>PERCENT</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
    <statistic href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a/statistics/892b69a7-41ca-36b1-9a2e-ae5177ef21bb" id="892b69a7-41ca-36b1-9a2e-ae5177ef21bb">
        <name>migration.progress</name>
        <description>Migration Progress</description>
        <values type="DECIMAL">
            <value>
                <datum>0</datum>
            </value>
        </values>
        <type>GAUGE</type>
        <unit>PERCENT</unit>
        <vm href="/ovirt-engine/api/vms/787f3b91-c0b5-47e0-b14f-f8c01577073a" id="787f3b91-c0b5-47e0-b14f-f8c01577073a"/>
    </statistic>
</statistics>
 
2014-08-06 19:20:11,675 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for memory.installed: 1073741824.0
2014-08-06 19:20:11,675 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for memory.used: 0.0
2014-08-06 19:20:11,675 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for cpu.current.guest: 0.0
2014-08-06 19:20:11,676 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for cpu.current.hypervisor: 0.0
2014-08-06 19:20:11,676 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for cpu.current.total: 0.0
2014-08-06 19:20:11,676 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - Correct value for migration.progress: 0.0
2014-08-06 19:20:11,677 - MainThread - rhevm_api.tests_lib.low_level.vms - INFO - All 5 statistics appear
Comment 5 errata-xmlrpc 2015-02-11 13:02:43 EST
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://rhn.redhat.com/errata/RHSA-2015-0158.html

Note You need to log in before you can comment on or make changes to this bug.