Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1371195

Summary: Calculation of average storage domains is wrong for dashboards
Product: [oVirt] ovirt-engine Reporter: Shirly Radco <sradco>
Component: GeneralAssignee: Shirly Radco <sradco>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.0.2.7CC: bugs, oourfali, sradco
Target Milestone: ovirt-4.0.4Keywords: ZStream
Target Release: 4.0.4.2Flags: rule-engine: ovirt-4.0.z+
ykaul: planning_ack+
oourfali: devel_ack+
ykaul: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:34:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shirly Radco 2016-08-29 14:27:20 UTC
Description of problem:
The calculation of average storage domains is wrong


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

How reproducible:
100%

Steps to Reproduce:
1. Install engine
2. Check the storage domain available,used and total size vs. the data in the dashboards.

Actual results:
Data is incorrect

Expected results:
Data should be calculated currectly

Additional info:

Comment 2 Pavel Novotny 2016-09-08 17:13:10 UTC
Can you please describe more what are the steps for verification here?
Also see my questions below.

(In reply to Shirly Radco from comment #0)
[snip]
> Steps to Reproduce:
> 1. Install engine
> 2. Check the storage domain available,used and total size vs. the data in
> the dashboards.

Does the wrong avg. value show immediately after adding new storage
or does it show after some time, e.g., after few minutes, hours?

> 
> Actual results:
> Data is incorrect

Incorrect how? Higher, lower, double, zero ... than it should be?
Thanks.

Comment 3 Shirly Radco 2016-09-11 05:53:50 UTC
(In reply to Pavel Novotny from comment #2)
> Can you please describe more what are the steps for verification here?
> Also see my questions below.
> 
> (In reply to Shirly Radco from comment #0)
> [snip]
> > Steps to Reproduce:
> > 1. Install engine
> > 2. Check the storage domain available,used and total size vs. the data in
> > the dashboards.
> 
> Does the wrong avg. value show immediately after adding new storage
> or does it show after some time, e.g., after few minutes, hours?
> 
> > 
> > Actual results:
> > Data is incorrect
> 
> Incorrect how? Higher, lower, double, zero ... than it should be?
> Thanks.

Previously the calculation was
usage percentage = used_disk_size_gb AS float / available_disk_size_gb

It should be 
usage percentage = (used_disk_size_gb AS float) / (used_disk_size_gb + available_disk_size_gb)

Comment 4 Pavel Novotny 2016-09-14 15:26:37 UTC
Verified in rhevm-4.0.4.2-0.1.el7ev.noarch

Verification steps: 
1. Install ovirt-engine.
2. Add 2 storages (each one has: Size: 767 GB, Available: 230 GB, Used: 537 GB)
3. Check the usage percentage reported in Dashboard - Storage Utilization 
   and compare it with computed result.

Result:

Usage formula:
> usage percentage = (used_disk_size_gb AS float) / (used_disk_size_gb + vailable_disk_size_gb)
I. e.:
537*2 / ( 537*2 + 230*2) = 0,700130378 -> 70%

Dashboard shows: 70% TiB Used
It matches the computed result.