Bug 1337278 - Inaccurate chargeback cost reported with tiered rates
Summary: Inaccurate chargeback cost reported with tiered rates
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: GA
: 5.6.0
Assignee: tledesma
QA Contact: Nandini Chandra
URL:
Whiteboard: chargeback
Depends On:
Blocks: 1347696
TreeView+ depends on / blocked
 
Reported: 2016-05-18 17:05 UTC by Nandini Chandra
Modified: 2017-09-13 19:21 UTC (History)
11 users (show)

Fixed In Version: 5.6.0.12
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1347696 (view as bug list)
Environment:
Last Closed: 2016-06-29 16:03:59 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Chargeback report (37.92 KB, application/pdf)
2016-05-18 17:09 UTC, Nandini Chandra
no flags Details
Chargeback_report_june15 (36.56 KB, application/pdf)
2016-06-15 07:28 UTC, Nandini Chandra
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Internal Links: 1361222 1410535

Description Nandini Chandra 2016-05-18 17:05:33 UTC
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:
---------------

Comment 2 Nandini Chandra 2016-05-18 17:08:00 UTC
Attached generated chargeback report.

Comment 3 Nandini Chandra 2016-05-18 17:09:43 UTC
Created attachment 1159002 [details]
Chargeback report

Comment 4 Nandini Chandra 2016-05-18 17:12:01 UTC
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.

Comment 5 Gregg Tanzillo 2016-05-31 16:24:02 UTC
https://github.com/ManageIQ/manageiq/pull/8862

Comment 7 Nandini Chandra 2016-06-15 07:28:28 UTC
Created attachment 1168233 [details]
Chargeback_report_june15

Comment 10 Amaury Glez 2016-06-16 14:55:43 UTC
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.

Comment 12 Amaury Glez 2016-06-17 10:47:54 UTC
(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.

Comment 18 CFME Bot 2016-06-20 18:40:59 UTC
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(-)

Comment 19 Oleg Barenboim 2016-06-20 18:51:38 UTC
Merged and backported https://github.com/ManageIQ/manageiq/pull/9298 to Darga

Comment 20 Nandini Chandra 2016-06-23 17:28:48 UTC
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.

Comment 22 errata-xmlrpc 2016-06-29 16:03:59 UTC
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


Note You need to log in before you can comment on or make changes to this bug.