Bug 1433984 - CFME collects C&U metrics even before resource creation
Summary: CFME collects C&U metrics even before resource creation
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Šimon Lukašík
QA Contact: Nandini Chandra
URL:
Whiteboard: c&u
: 1439034 (view as bug list)
Depends On:
Blocks: 1441244 1465077
TreeView+ depends on / blocked
 
Reported: 2017-03-20 13:50 UTC by Nandini Chandra
Modified: 2018-03-06 15:37 UTC (History)
7 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1441244 1465077 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:37:14 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nandini Chandra 2017-03-20 13:50:58 UTC
Description of problem:
------------------------
The fix for https://bugzilla.redhat.com/show_bug.cgi?id=1419186 was to get Chargeback reports to skip hourly rollups that are older than the VM itself.

I did some investigation while verifying this BZ and found that CFME collects metrics for resources before resource creation.
 
vm.metric_rollups.order(:timestamp).where(:capture_interval_name =>
'hourly').first.timestamp
=> Mon, 13 Feb 2017 21:00:00 UTC +00:00

vm.created_on
=> Mon, 13 Feb 2017 22:02:53 UTC +00:00

BZ 1419186 affects versions > 5.6 only.So, the fix is relevant to 
CFME version > 5.6. 

In 5.6, Chargeback reports do not skip hourly rollups that are older than VMs.
In 5.7, Chargeback reports skip hourly rollups that are older than VMs.


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


How reproducible:
-----------------
Always


Steps to Reproduce:
-------------------
1.Manage a provider.Enable C&U collection for the provider.


Actual results:
---------------
CFME collects C&U metrics even before resource creation.


Expected results:
-----------------
It's not necessary for CFME to collect C&U metrics before resource creation.


Additional info:
----------------

Comment 2 Nandini Chandra 2017-03-20 13:51:54 UTC
I have been discussing this issue with Simon Lukasik.

Comment 3 Šimon Lukašík 2017-03-20 14:22:08 UTC
Perhaps we can charge for it, since it is collected. This needs deeper look. How far to the history we collect on a first refresh?

Comment 4 Šimon Lukašík 2017-04-06 12:06:59 UTC
*** Bug 1439034 has been marked as a duplicate of this bug. ***

Comment 5 Šimon Lukašík 2017-04-06 12:10:27 UTC
https://github.com/ManageIQ/manageiq/pull/14666

Comment 9 Nandini Chandra 2017-11-16 18:06:47 UTC
Verified in 5.9.0.5.

Verified that Chargeback reports don't skip records older than the VM itself and take into consideration  all the records/C&U data fetched from the first collection. (in case VM was already existing when the provider was added).


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