Bug 1787350

Summary: The value of memory threshold in the Advanced config is only nearly right and the units are not correct.
Product: Red Hat CloudForms Management Engine Reporter: Jaroslav Henner <jhenner>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED CURRENTRELEASE QA Contact: Parthvi Vala <pvala>
Severity: low Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: low    
Version: 5.10.13CC: abellott, akarol, bmidwood, dmetzger, hkataria, jocarter, lavenel, mpovolny, obarenbo, yrudman
Target Milestone: GA   
Target Release: 5.10.z   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-28 14:34:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Jaroslav Henner 2020-01-02 13:58:44 UTC
Description of problem:
There are two problems:

When setting the memory threshold of worker on the Worker tab to not-integral value of GB, the value in the Advanced config is then not exactly right.

As can be guessed, some attempt was made to use GiB, but then it is incorrect to use the GB suffix and the value is computed wrong for certain inputs (note the 1124 and 1224) in the actual behaviour.

The actual behaviour:
Worker tab | actual advanced config value | expected (if GiB is meant)
1.1 GB     | 1178599424 = 1124 * 1024**2  | 1181116006.4 = 1.1 * 1024**3
1.2 GB     | 1283457024 = 1224 * 1024**2  | 1288490188.8 = 1.2 * 1024**3

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

How reproducible:
3/3

Steps to Reproduce:
1. Set the value in the workers tab to not an integral value of GB
2. Observe the value of the threshold of the worker in the advanced tab
3.

Actual results:
the advanced tab contains wrongly computed value

Expected results:
If the Worker tab value suffix is GiB. Then the advanced tab should contain the value * 1024**3
If the Worker tab value suffix is MiB. Then the advanced tab should contain the value * 1024**2

Additional info:
https://en.wikipedia.org/wiki/Gibibyte

Comment 2 Yuri Rudman 2020-01-03 14:55:50 UTC
confirmed that Issue exists in 5.10 - :memory_threshold: incorrectly converted to bytes before savings

latest master and 5.11 do not have reported issue, :memory_threshold: settings for all workers saved as shown on UI
Example: 1.1 GB shown on UI saved as 1.1.gigabytes

Comment 5 dmetzger 2020-01-28 14:34:15 UTC
Closing - fixed in current release