Bug 1467756 - CloudForms does not show region-level Utilization from "Optimize" -> "Utilization" menu
Summary: CloudForms does not show region-level Utilization from "Optimize" -> "Utiliza...
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
high
Target Milestone: GA
: 5.9.0
Assignee: Gregg Tanzillo
QA Contact: Alex Newman
URL:
Whiteboard:
Depends On:
Blocks: 1511130
TreeView+ depends on / blocked
 
Reported: 2017-07-05 01:45 UTC by tachoi
Modified: 2020-12-14 09:01 UTC (History)
11 users (show)

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


Attachments (Terms of Use)
screenshots (22.89 KB, image/png)
2017-10-09 08:48 UTC, Loic Avenel
no flags Details

Description tachoi 2017-07-05 01:45:14 UTC
Description of problem:
Login to CloudForms and select "Optimize" -> "Utilization", and then the "Details" report, all of the chart data points are either "0Mhz" (trend of CPU used), "0B" (trend of RAM used) or "0B" (trend of used disk space).

Having C&U collection for the region set to "Collect for all clusters" and "Collect for all datastores". In addition, already verified that all instances are reporting CPU, RAM and Disk IO metrics via OSP Gnocchi, and this is visible in the CFME UI.

Version-Release number of selected component (if applicable):
CFME 5.7.1.3
OSP 10 with Gnocchi configured for metrics collection

How reproducible:
See below

Steps to Reproduce:
1. Add OSP 10 provider to CFME 
2. Setup metrics collection from CFME as well as OSP10 side
3. Check metrics info is available from instance level
4. Navigate to "Optimize" -> "Utilization" UI for region level report.

Actual results:
No data available 

Expected results:
Corresponding date is reported

Additional info:
Had a check with CFME 4.8.0, having same issue.

Comment 23 Joe Rafaniello 2017-09-28 19:59:24 UTC
After some debugging with GreggT, we found that the UI code is intentionally not showing cloud environments in the Optimize -> Utilization tree.

The commit that "removed" ems_clouds:

https://github.com/ManageIQ/manageiq/commit/182f1a4e7a2db48e6882b9d5a1506d1d517b2c49

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

From that BZ "Filter out cloud providers from the Optimize trees" 

"Since we don't have that capability for cloud providers (EC2 and OpenStack) we should not present those providers in the trees for selection."

Undoing much of that commit brings back the missing ems_clouds such as openstack, azure, etc.


diff --git a/app/presenters/tree_builder_region.rb b/app/presenters/tree_builder_region.rb
index bcd44550a..47b92f87a 100644
--- a/app/presenters/tree_builder_region.rb
+++ b/app/presenters/tree_builder_region.rb
@@ -21,11 +21,7 @@ class TreeBuilderRegion < TreeBuilder
   end

   def x_get_tree_region_kids(object, count_only)
-    emstype = if [:bottlenecks, :utilization].include?(@type)
-                object.ems_infras
-              else
-                object.ext_management_systems
-              end
+    emstype = object.ext_management_systems
     emses = Rbac.filtered(emstype)
     storages = Rbac.filtered(object.storages)
     if count_only
@@ -53,7 +49,7 @@ class TreeBuilderRegion < TreeBuilder
     id = from_cid(nodes.last.split('-').last)
     if object_ems?(nodes, object)
       rec = MiqRegion.find_by_id(id)
-      objects = rbac_filtered_sorted_objects(rec.ems_infras, "name")
+      objects = rbac_filtered_sorted_objects(rec.ext_management_systems, "name")
       count_only_or_objects(count_only, objects)
     elsif object_ds?(nodes, object)
       rec = MiqRegion.find_by_id(id)

Comment 28 Loic Avenel 2017-10-09 08:48:56 UTC
Created attachment 1336209 [details]
screenshots

Comment 30 Joe Rafaniello 2017-10-09 18:58:48 UTC
Loic, I don't understand.  This was a feature asked for back in 2013.  It seems like the feature is now invalid and we need to reimplement it correctly.

> So, you must add Director as
> an infra provider.

Are you saying that the user needs to create the openstack director manually as an infra provider to make this work?  Or, are you saying, that we as developers are failing to add this correctly as an infra provider?

Is the whole utilization tab relevant for all infra providers and openstack infra?
Is it just some specific areas of utilization?  

Can we go back to showing all of the management systems and show no data for the cloudy environments that don't collect the relevant data?  Filtering it out in the tree builder code seems like a bad idea.  We should offer all providers we know about and allow the user to filter them.

What do you think?

Comment 31 Loic Avenel 2017-10-10 10:40:19 UTC
(In reply to Joe Rafaniello from comment #30)
> Loic, I don't understand.  This was a feature asked for back in 2013.  It
> seems like the feature is now invalid and we need to reimplement it
> correctly.
> 
> > So, you must add Director as
> > an infra provider.
> 
> Are you saying that the user needs to create the openstack director manually
> as an infra provider to make this work?  Or, are you saying, that we as
> developers are failing to add this correctly as an infra provider?
> 
> Is the whole utilization tab relevant for all infra providers and openstack
> infra?
> Is it just some specific areas of utilization?  
> 
> Can we go back to showing all of the management systems and show no data for
> the cloudy environments that don't collect the relevant data?  Filtering it
> out in the tree builder code seems like a bad idea.  We should offer all
> providers we know about and allow the user to filter them.
> 
> What do you think?

OpenStack Director is part of the Infra Provider options, it is already there. You can add OpenStack Director today like you will add Vmware. Then CF will collect metrics for Clusters and Hosts.. in CF 4.2, we validated/Corrected that OpenStack Director is showing in Optimize>utilisation.. 

It seems in 4.5, it seems there is an issue because In our demo lab, we see only one Provider which is RHEV, we don't see anything else Vmware, OpenStack Director are not there...

Comment 33 CFME Bot 2017-10-13 13:51:42 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/cb3cb72d336ade55203056436cdb7a0850d9807a

commit cb3cb72d336ade55203056436cdb7a0850d9807a
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Wed Oct 11 17:17:18 2017 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Fri Oct 13 06:58:21 2017 -0400

    Ensure that `base_class` of first target is used for RBAC scope
    
    When targets are passed and the instances are of different subclasses through STI, the base class needs
    to be used for building the scope to prevent ActiveRecord from also scoping to the subclass and limiting
    the results to only instances of that class.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480812
    https://bugzilla.redhat.com/show_bug.cgi?id=1467756

 lib/rbac/filterer.rb           |  5 +++++
 spec/lib/rbac/filterer_spec.rb | 43 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 1 deletion(-)

Comment 34 Joe Rafaniello 2017-10-16 14:17:33 UTC
Note, the code change for this BZ only fixes that fact that a single ems_infra class were being displayed, such as seeing only rhev, and not openstack infra, vmware, etc.  

This BZ does not change the fact that we only show virtual infrastructure providers in the optimize/utilization.  We still "assume" that cloud environments will not have the metrics data to be relevant in these screens.

Comment 35 Loic Avenel 2017-10-16 14:18:32 UTC
(In reply to Joe Rafaniello from comment #34)
> Note, the code change for this BZ only fixes that fact that a single
> ems_infra class were being displayed, such as seeing only rhev, and not
> openstack infra, vmware, etc.  
> 
> This BZ does not change the fact that we only show virtual infrastructure
> providers in the optimize/utilization.  We still "assume" that cloud
> environments will not have the metrics data to be relevant in these screens.

Yes, that is make sense


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