Bug 1595583

Summary: Number of instances shows one more than actual value in Networks>subnets
Product: Red Hat CloudForms Management Engine Reporter: Niladri Roy <niroy>
Component: ReportingAssignee: Keenan Brock <kbrock>
Status: CLOSED ERRATA QA Contact: Ido Ovadia <iovadia>
Severity: medium Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gblomqui, gdubreui, hkataria, jfrey, jhardy, kbrock, lavenel, mpovolny, niroy, obarenbo, pmukhedk, simaishi
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:03:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1595269    

Description Niladri Roy 2018-06-27 07:55:38 UTC
Description of problem:
In the Networks> Subnets view, for openstack provider subnets, the number of instances show one more than actual value. for example, if the number of instances is 2 for that subnet, it would show 3

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

How reproducible:

Steps to Reproduce:
1. Go to Networks > Subnets 
2. Notice the number of instances would be one more than the value shown in Networks > Networks

Actual results:
Number of instances shows 1 more than actual value

Expected results:
Number of instances should be shown accurately

Additional info:

Comment 4 Gilles Dubreuil 2018-06-28 13:03:36 UTC
Hi Niladri,

To clarify the description of the issue, the number of subnets shown in CloudForms (Network -> Subnet) is more than the number of subnets visible in OpenStack. Is that correct? 

Are undercloud (director - infra) and overcloud defined in CF? In which case any network and subnet defined in the undercloud are also added to the list of visible items in the Cloud Network and Cloud Subnet pages. So by default that makes +1 network and +1 subnet.


Comment 7 Gilles Dubreuil 2018-06-29 03:20:46 UTC
I confirm the total number of instances displayed in the "Cloud Subnet" summary page is wrong. The total has one more count than it should.   

The right value is actually available on each subnet detail by clicking on a specific subnet. That could be used as a workaround for now.

This issue can be reproduced on master/HEAD branch where it would have to be fixed before being back ported to current version.

Comment 11 CFME Bot 2018-07-10 15:41:31 UTC
New commit detected on ManageIQ/manageiq/master:

commit f0a3dd571bf4fa71e68e5a7b174f93b8d497a459
Author:     Keenan Brock <keenan@thebrocks.net>
AuthorDate: Mon Jul  9 16:41:51 2018 -0400
Commit:     Keenan Brock <keenan@thebrocks.net>
CommitDate: Mon Jul  9 16:41:51 2018 -0400

    Network Subnet total_vms work correctly


    CloudSubnet#total_vms does not use distinct for the count
    CloudNetwork#total_vms does

    after: both use distinct (since it is going :through a has_many

 app/models/cloud_subnet.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 12 Keenan Brock 2018-07-10 16:02:31 UTC
Hi Prasad,

That patch fixes the problems: https://github.com/ManageIQ/manageiq/pull/17683
Leaving as ON_DEV until a build is made


Comment 13 Ido Ovadia 2018-08-14 15:04:19 UTC

Comment 14 errata-xmlrpc 2019-02-07 23:03:14 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.