Bug 1782902

Summary: openshift vms using G, M units cause storage consumption to be ignored in reports
Product: Red Hat CloudForms Management Engine Reporter: Felix Dewaleyne <fdewaley>
Component: ProvidersAssignee: Adam Grare <agrare>
Status: CLOSED NOTABUG QA Contact: juwatts
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.13CC: dmetzger, fdewaley, jfrey, jhardy, obarenbo
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.12.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1785358 1785361 (view as bug list) Environment:
Last Closed: 2020-06-10 13:09:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1785358, 1785361    

Description Felix Dewaleyne 2019-12-12 15:44:23 UTC
Description of problem:
openshift vms using G, M units cause storage consumption to be ignored in reports

Version-Release number of selected component (if applicable):
cloudforms 5.10.13.1
openshift 5.10.z@07374985 

How reproducible:
all the time (customer environment

Steps to Reproduce:
1. set vms in openshift to use M as a unit
2. refresh provider
3. generate report on storage consumption of the provider

Actual results:
no value in the report

Expected results:
values in the report

Additional info:
durring refreshes, warnings are raised :
1847947:[----] W, [2019-11-30T15:53:49.948766 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 50M
1847948:[----] W, [2019-11-30T15:53:50.031714 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 100G
1847949:[----] W, [2019-11-30T15:53:50.033720 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 50M
1847950:[----] W, [2019-11-30T15:53:50.035234 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 50M
1847951:[----] W, [2019-11-30T15:53:50.036692 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 1G
1847952:[----] W, [2019-11-30T15:53:50.038182 #20100:9fb118]  WARN -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 50M

Comment 7 CFME Bot 2019-12-15 10:51:24 UTC
New commit detected on ManageIQ/manageiq-providers-kubernetes/master:

https://github.com/ManageIQ/manageiq-providers-kubernetes/commit/89de5b82c12e47bf632017a59d5fd79dd7e18c4e
commit 89de5b82c12e47bf632017a59d5fd79dd7e18c4e
Author:     Adam Grare <agrare>
AuthorDate: Thu Dec 12 09:52:46 2019 -0500
Commit:     Adam Grare <agrare>
CommitDate: Thu Dec 12 09:52:46 2019 -0500

    Fix parsing capacity fields of the form 50M or 1G

    If the storage capacity attribute is of the form 50M or 1G the
    parse_capacity_field method which only expects IEC 60027-2 style values
    will fail:

    ```
    MIQ(ManageIQ::Providers::Openshift::ContainerManager::RefreshParser#parse_capacity_field) Capacity attribute - storage was in bad format - 1G
    ```

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1782902

 app/models/manageiq/providers/kubernetes/container_manager/refresh_parser.rb | 2 +-
 spec/models/manageiq/providers/kubernetes/container_manager/refresh_parser_spec.rb | 48 +
 2 files changed, 49 insertions(+), 1 deletion(-)