Description of problem: ----------------------- Inaccurate chargeback costs are being reported with tiered rates. I've used a custom tiered rate to generate a Chargeback report on my 5.6 appliance.Here's a table of the rates for Used CPU USD/Day/MHz Range(start-finish)|Rate(fixed, variable) -------------------------------- 0.0 - 700.0 |0, 0.04 700 - 3500 |0, 0.03 3500- 8500 |0, 0.02 8500-Infinity |0, 0.01 The 'Used CPU' for one of my infra VMs is 1 GHz in a day.Going by this table,the rate is 0.03 USD/Day/Mhz.The reported cost in the Chargeback report is $ 2.07. Based on my calculation, the cost should be $1.25 CPU used cost = Used CPU in MHz * CPU rate per MHz per day / 24 1 GHz = 1000 MHz CPU Used Cost = 1000 MHz * $0.03 (per MHz per day) / 24 = $ 1.25 Version-Release number of selected component (if applicable): ----------------------------- 5.6.0.6 How reproducible: ----------------- Always Steps to Reproduce: ------------------- 1.Define a custom tiered rate for a metric; for eg: CPU used 2.Create a chargeback report based on the tiered rate. Actual results: -------------- Inaccurate chargeback costs reported with tiered rates. Expected results: ---------------- Accurate chargeback costs should be reported with tiered rates. Additional info: ---------------
Attached generated chargeback report.
Created attachment 1159002 [details] Chargeback report
In the issue description, I'm referring to the 'cu-24x7' VM. My chargeback cost calculation is based on its CPU usage(1 GHz) on 5/13/2016.
https://github.com/ManageIQ/manageiq/pull/8862
Created attachment 1168233 [details] Chargeback_report_june15
Like Gregg Tanzillo says, in manageIQ this bug was fixed with https://github.com/ManageIQ/manageiq/pull/8862 . You are working on Cloudforms, then this bug will be solved in the next release of Cloudforms.
(In reply to Amaury Glez from comment #10) > Like Gregg Tanzillo says, in manageIQ this bug was fixed with > https://github.com/ManageIQ/manageiq/pull/8862.
https://github.com/ManageIQ/manageiq/pull/9298
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/9283ea7b61811be33b8dfbac2c4bf53dad68eb1b commit 9283ea7b61811be33b8dfbac2c4bf53dad68eb1b Author: Gregg Tanzillo <gtanzill> AuthorDate: Mon Jun 20 12:46:56 2016 -0400 Commit: Gregg Tanzillo <gtanzill> CommitDate: Mon Jun 20 12:46:56 2016 -0400 Limit tiered rates "Per Time" to only hourly Chargeback reports are generated by pulling hourly metrics, selecting rates and converting the selected rate to hourly and applying the selected to the hourly metric value. This does not work very well with tiered rates that are not hourly because it will use the hourly metric to select a tier that may be daily, weekly or monthly. This change mitigates the this by limiting to only hourly when adding or editing rate tiers. https://bugzilla.redhat.com/show_bug.cgi?id=1337278 app/controllers/chargeback_controller.rb | 2 +- app/views/chargeback/_tier_first_row.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Merged and backported https://github.com/ManageIQ/manageiq/pull/9298 to Darga
Verified in 5.6.0.12. Verified that tiered rates are limited to only hourly and that the daily/weekly/monthly options have been removed from the UI.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1348