Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1517956

Summary: ERROR -- : [NoMethodError]: undefined method `*' while generating Chargeback reports for cloud providers with volumes
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ReportingAssignee: Libor Pichler <lpichler>
Status: CLOSED CURRENTRELEASE QA Contact: Nandini Chandra <nachandr>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gtanzill, jhardy, lpichler, obarenbo
Target Milestone: Beta 4   
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.9.0.15 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1516575 Environment:
Last Closed: 2018-03-06 15:22:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core
Bug Depends On: 1516575    
Bug Blocks:    
Attachments:
Description Flags
Available fields while adding a Chargeback report none

Comment 2 CFME Bot 2017-11-29 20:24:41 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:
https://github.com/ManageIQ/manageiq/commit/590c2b5158ffb970ee48ce9e97613517b575eff7

commit 590c2b5158ffb970ee48ce9e97613517b575eff7
Author:     Gregg Tanzillo <gtanzill@redhat.com>
AuthorDate: Mon Nov 27 11:26:28 2017 -0500
Commit:     Satoe Imaishi <simaishi@redhat.com>
CommitDate: Mon Nov 27 13:14:46 2017 -0500

    Merge pull request #16434 from lpichler/fix_nil_cases_of_allocated_disk_types
    
    Fix nil cases of allocated disk types in chargeback reporting
    (cherry picked from commit a807056bdfa126b91f6aefe1b350e66c5bbdadc6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1517956

 app/models/chargeback/consumption_with_rollups.rb  |  2 +-
 .../chargeback/consumption_with_rollups_spec.rb    | 38 ++++++++++++++++++++++
 spec/models/vim_performance_state_spec.rb          | 13 ++++++++
 3 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 spec/models/chargeback/consumption_with_rollups_spec.rb

Comment 5 CFME Bot 2017-12-01 16:27:09 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:
https://github.com/ManageIQ/manageiq/commit/1ad25ed36517a2e917365b2b4374ab338d25b77a

commit 1ad25ed36517a2e917365b2b4374ab338d25b77a
Author:     Gregg Tanzillo <gtanzill@redhat.com>
AuthorDate: Fri Dec 1 10:37:25 2017 -0500
Commit:     Satoe Imaishi <simaishi@redhat.com>
CommitDate: Fri Dec 1 11:10:10 2017 -0500

    Merge pull request #16575 from lpichler/fix_empty_array_in_chargeback_storage_report
    
    Fix max method on empty array in chargeback storage report
    (cherry picked from commit a06bd40f283a83c4d58cf6edf312993158f23e18)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1517956

 app/models/chargeback/consumption_with_rollups.rb       |  3 ++-
 spec/models/chargeback/consumption_with_rollups_spec.rb | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

Comment 6 Nandini Chandra 2017-12-13 18:32:54 UTC
I'm trying to verify this BZ on an 5.9.0.12 appliance that manages ec2.

The new volume types get dynamically listed in the Storage Rates, but don't get dynamically listed in the Available fields section while creating a Chargeback report.See attached screen shot.

Comment 7 Nandini Chandra 2017-12-13 18:34:50 UTC
Created attachment 1367519 [details]
Available fields while adding a Chargeback report

Comment 11 Nandini Chandra 2017-12-18 23:18:57 UTC
It looks like this issue occurs only when a new volume type is added  or when an existing volume type is modified.

The new volume type gets dynamically listed on the Chargeback rate editor, but not in the 'Available fields' section while creating a report.

Comment 12 Nandini Chandra 2017-12-19 17:23:26 UTC
*** Bug 1518841 has been marked as a duplicate of this bug. ***

Comment 13 Gregg Tanzillo 2017-12-19 17:58:56 UTC
https://github.com/ManageIQ/manageiq/pull/16683

Comment 14 CFME Bot 2018-01-03 16:31:46 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:
https://github.com/ManageIQ/manageiq/commit/cf02454b2433b066ca562d5307770f7cc4579eff

commit cf02454b2433b066ca562d5307770f7cc4579eff
Author:     Gregg Tanzillo <gtanzill@redhat.com>
AuthorDate: Tue Dec 19 10:08:21 2017 -0500
Commit:     Satoe Imaishi <simaishi@redhat.com>
CommitDate: Wed Jan 3 09:46:41 2018 -0500

    Merge pull request #16683 from lpichler/stop_cash_fields_for_chargebackvm_report
    
    Stop cashing fields for ChargebackVm report
    (cherry picked from commit 6352baf2f24699519c7d96c9dc7b96a9f245f1e9)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1517956

 app/models/chargeback_vm.rb       | 16 ++++++++++++
 lib/miq_expression.rb             |  2 ++
 spec/lib/miq_expression_spec.rb   | 51 +++++++++++++++++++++++++++++++++++++++
 spec/models/chargeback_vm_spec.rb | 14 +++++++++++
 4 files changed, 83 insertions(+)

Comment 16 Nandini Chandra 2018-01-31 14:57:50 UTC
Verified in 5.9.0.18

Reproducer:

1)Add a  new volume type or modify an existing volume type for a cloud instance.

Before fix:
The new volume type gets dynamically listed on the Chargeback rate editor, but not in the 'Available fields' section while creating a report.

After fix:
The new volume type gets dynamically listed on the Chargeback rate editor, as well as in the 'Available fields' section while creating a report.