Bug 1004671

Summary: [fork][origin_ui_58] The count of left node is incorrect for suggestions when we have multi districts
Product: OKD Reporter: zhaozhanqi <zzhao>
Component: WebsiteAssignee: Luke Meyer <lmeyer>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: xtian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-19 16:46:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description zhaozhanqi 2013-09-05 07:52:15 UTC
Description of problem:
If node_needed > suggest_node_per_distrct,then need to suggestions to add nodes to district, like this suggestion:"Add 4 nodes to district dist1, which according to an active gear percent of 10% has room for 22 more nodes."  here 22 is incorrect, It  should be the count of the left nodes of every district, not district*count - node_exist

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

How reproducible:
always

Steps to Reproduce:
1. create four small districts and add two nodes to one district(dist1)
2. set "GEAR_EXPECTED_ACTIVE_PERCENT=10" and "GEAR_UP_THRESHOLD=1000, small: 1980, large: 750

node_needed=1980/90=22 -2=20
suggest_node_per_district=6000*10/90*100=6

3.login on admin-console

Actual results:
suggestion:"Add 4 nodes to district dist1, which according to an active gear percent of 10% has room for 22 more nodes.

22=district_count*suggest_node_per_district- node_exist=6*4-2=22

Expected results:
suggestion:"Add 4 nodes to district dist1, which according to an active gear percent of 10% has room for 4 more nodes.

suggest_node_per_district-node_exist=6-2=4.

Additional info:

Comment 1 Luke Meyer 2013-09-05 21:47:03 UTC
Awesome catch. You are really paying close attention.

I think that number is meant to be the total that can be created in all districts, so it's being misrepresented. But it needs to be fixed regardless.

Comment 2 Luke Meyer 2013-09-05 22:27:36 UTC
Should be fixed in fork_ami origin_ui_81 #824

Comment 3 zhaozhanqi 2013-09-09 02:16:36 UTC
Tested this bug on fork_ami origin_ui_81_825

Add 3 nodes to district d1, which according to an active gear percent of 5% has room for 3 more nodes.

oo-admin-ctl-district -c add-node -n 'd1' -i <server_identity>
Add 3 nodes to district d2, which according to an active gear percent of 5% has room for 3 more nodes.

oo-admin-ctl-district -c add-node -n 'd2' -i <server_identity>

Comment 4 openshift-github-bot 2013-09-09 20:19:06 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/2625a6adca69006d1cfd47ca9992a02bc5b5831f
<admin suggestions> fix bug 1004671

https://bugzilla.redhat.com/show_bug.cgi?id=1004671
The count of nodes left is incorrect for suggestions when we have
multiple districts

The total nodes that could be created in all existing districts was
given, rather than how many could be created in a particular district.
Should correctly show per-district space for nodes now.