Bug 1103490 - [REST API]: Missing VM statistics field.
Summary: [REST API]: Missing VM statistics field.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Tomas Jelinek
QA Contact: Ilanit Stein
URL:
Whiteboard: virt
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-06-01 13:24 UTC by Ilanit Stein
Modified: 2015-02-12 07:56 UTC (History)
14 users (show)

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.
Clone Of:
Environment:
Last Closed: 2015-02-11 18:02:43 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0158 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Virtualization Manager 3.5.0 2015-02-11 22:38:50 UTC
oVirt gerrit 28342 0 master MERGED restapi: fix NPE on vm statistics Never

Description Ilanit Stein 2014-06-01 13:24:24 UTC
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 18:08:46 UTC
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 08:27:06 UTC
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 18:02:43 UTC
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.