Bug 1892291

Summary: Change the representation of empty disk.usage statistics
Product: [oVirt] ovirt-engine Reporter: Polina <pagranat>
Component: BLL.VirtAssignee: Arik <ahadas>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.3.7CC: ahadas, bugs, tgolembi
Target Milestone: ovirt-4.4.4Flags: pm-rhel: ovirt-4.4+
Target Release: 4.4.4.2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.4.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-26 22:31:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Polina 2020-10-28 12:16:38 UTC
Description of problem:
Now statistics response for disk.usage of not running VM is <values><value><detail></detail></value></values>.
for other statistics, if there is a no value, it appears, like  <values/> or
        <values>
            <value>
                <datum>0</datum>
            </value>
        </values>

Version-Release number of selected component (if applicable):4.4.3

How reproducible:always


Steps to Reproduce:
1. Create VM on the base of last infra template (tried both latest-rhel-guest-image-8.1-infra and 8.2).
2. Send Get statistics request for the VM (not running)
https://{{host}}/ovirt-engine/api/vms/{{vmID}}/statistics.

Actual result:
   <statistic href="/ovirt-engine/api/vms/38529667-032a-4655-a22f-a17ff83f5dc8/statistics/c5dd0086-d5f0-3abf-9628-4674abb3f5ac" id="c5dd0086-d5f0-3abf-9628-4674abb3f5ac">
        <name>disks.usage</name>
        <description>Disk usage, in bytes, per filesystem as JSON (agent)</description>
        <kind>gauge</kind>
        <type>string</type>
        <unit>none</unit>
        <values>
            <value>
                <detail></detail>
            </value>
        </values>
        <vm href="/ovirt-engine/api/vms/38529667-032a-4655-a22f-a17ff83f5dc8" id="38529667-032a-4655-a22f-a17ff83f5dc8"/>
    </statistic>

Expected results:
for other statistics, if there is a no value, it appears, like  <values/> or
        <values>
            <value>
                <datum>0</datum>
            </value>
        </values>

also <unit>none</unit> must be changed to <unit>bytes</unit>

Additional info:
related to https://bugzilla.redhat.com/show_bug.cgi?id=1814565

Comment 1 Tomáš Golembiovský 2020-11-13 11:44:20 UTC
(In reply to Polina from comment #0)

> also <unit>none</unit> must be changed to <unit>bytes</unit>

As mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1814565#c13 the unit should stay "none". The value of the statistic is a general JSON string. The value is not a "size in bytes".

Comment 2 Casper (RHV QE bot) 2020-11-26 22:31:22 UTC
This bug has low overall severity and passed an automated regression suite, and is not going to be further verified by QE. If you believe special care is required, feel free to re-open to ON_QA status.

Comment 3 Sandro Bonazzola 2020-12-21 12:38:51 UTC
This bugzilla is included in oVirt 4.4.4 release, published on December 21st 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.