Previously, the `oo-admin-ctl-app` command did not check the min_limit on the group_overrides while it was removing a gear from an application. This made it possible for a gear to be removed from a scalable application beyond the min_limit. This bug fix updates the `oo-admin-ctl-app` command to check the min_limit before removing a gear from a scalable application. As a result, the `remove-gear` command now fails if the number of gears have already reached the min_limit.
Description of problem:
- oo-admin-ctl-app -c remove-gear , ignores min scale setting and removes gear anyways. Application still shows minimum set even when actual number of gears is lower than minimum
Version-Release number of selected component (if applicable):
Tested on 2.2.6
How reproducible:
100%
Steps to Reproduce:
- Steps at bottom
Actual results:
Gear gets destroyed but keeps min set higher the actual number of gears.
Expected results:
Either does not allow, or sets new min.
Additional info:
#####
# rhc app create stest php-5.4 -s
# rhc cartridge scale php-5.4 --app stest --min 3
This operation will run until the application is at the minimum scale and may take several minutes.
Setting scale range for php-5.4 ... done
php-5.4 (PHP 5.4)
-----------------
Scaling: x3 (minimum: 3, maximum: available) on small gears
# oo-app-info -a stest
Loading broker environment... Done.
================================================================================
Login: demo
Plan: ()
App Name: stest
App UUID: 561fd346045486fa5a000002
Creation Time: 2015-10-15 04:24:39 PM
URL: http://stest-demo.apps.paas.it
Group Instance[0]:
Components:
Cartridge Name: php-5.4
Component Name: php-5.4
Gear[0]
Server Identity: node1.paas.it
Gear UUID: 561fd346045486fa5a000002
Gear UID: 5207
Gear[1]
Server Identity: node1.paas.it
Gear UUID: 561fd3b2045486fa5a000024
Gear UID: 4408
Gear[2]
Server Identity: node1.paas.it
Gear UUID: 561fd3c20454864967000003
Gear UID: 3816
Current DNS
-----------
stest-demo.apps.paas.it is an alias for node1.paas.it.
node1.paas.it has address 192.168.110.3
================================================================================
# oo-admin-ctl-app -c remove-gear -a stest -l demo --gear_uuid 561fd3b2045486fa5a000024
Success
# oo-app-info -a stest
Loading broker environment... Done.
================================================================================
Login: demo
Plan: ()
App Name: stest
App UUID: 561fd346045486fa5a000002
Creation Time: 2015-10-15 04:24:39 PM
URL: http://stest-demo.apps.paas.it
Group Instance[0]:
Components:
Cartridge Name: php-5.4
Component Name: php-5.4
Gear[0]
Server Identity: node1.paas.it
Gear UUID: 561fd346045486fa5a000002
Gear UID: 5207
Gear[1]
Server Identity: node1.paas.it
Gear UUID: 561fd3c20454864967000003
Gear UID: 3816
Current DNS
-----------
stest-demo.apps.paas.it is an alias for node1.paas.it.
node1.paas.it has address 192.168.110.3
================================================================================
# rhc app show stest
stest @ http://stest-demo.apps.paas.it/ (uuid: 561fd346045486fa5a000002)
------------------------------------------------------------------------
Domain: demo
Created: 12:24 PM
Gears: 2 (defaults to small)
Git URL: ssh://561fd346045486fa5a000002.paas.it/~/git/stest.git/
SSH: 561fd346045486fa5a000002.paas.it
Deployment: auto (on git push)
haproxy-1.4 (Web Load Balancer)
-------------------------------
Gears: Located with php-5.4
php-5.4 (PHP 5.4)
-----------------
Scaling: x2 (minimum: 3, maximum: available) on small gears
# rhc cartridge-status php-5.4 --app stest
RESULT:
Application is running
Application is running
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://rhn.redhat.com/errata/RHSA-2015-2666.html
Description of problem: - oo-admin-ctl-app -c remove-gear , ignores min scale setting and removes gear anyways. Application still shows minimum set even when actual number of gears is lower than minimum Version-Release number of selected component (if applicable): Tested on 2.2.6 How reproducible: 100% Steps to Reproduce: - Steps at bottom Actual results: Gear gets destroyed but keeps min set higher the actual number of gears. Expected results: Either does not allow, or sets new min. Additional info: ##### # rhc app create stest php-5.4 -s # rhc cartridge scale php-5.4 --app stest --min 3 This operation will run until the application is at the minimum scale and may take several minutes. Setting scale range for php-5.4 ... done php-5.4 (PHP 5.4) ----------------- Scaling: x3 (minimum: 3, maximum: available) on small gears # oo-app-info -a stest Loading broker environment... Done. ================================================================================ Login: demo Plan: () App Name: stest App UUID: 561fd346045486fa5a000002 Creation Time: 2015-10-15 04:24:39 PM URL: http://stest-demo.apps.paas.it Group Instance[0]: Components: Cartridge Name: php-5.4 Component Name: php-5.4 Gear[0] Server Identity: node1.paas.it Gear UUID: 561fd346045486fa5a000002 Gear UID: 5207 Gear[1] Server Identity: node1.paas.it Gear UUID: 561fd3b2045486fa5a000024 Gear UID: 4408 Gear[2] Server Identity: node1.paas.it Gear UUID: 561fd3c20454864967000003 Gear UID: 3816 Current DNS ----------- stest-demo.apps.paas.it is an alias for node1.paas.it. node1.paas.it has address 192.168.110.3 ================================================================================ # oo-admin-ctl-app -c remove-gear -a stest -l demo --gear_uuid 561fd3b2045486fa5a000024 Success # oo-app-info -a stest Loading broker environment... Done. ================================================================================ Login: demo Plan: () App Name: stest App UUID: 561fd346045486fa5a000002 Creation Time: 2015-10-15 04:24:39 PM URL: http://stest-demo.apps.paas.it Group Instance[0]: Components: Cartridge Name: php-5.4 Component Name: php-5.4 Gear[0] Server Identity: node1.paas.it Gear UUID: 561fd346045486fa5a000002 Gear UID: 5207 Gear[1] Server Identity: node1.paas.it Gear UUID: 561fd3c20454864967000003 Gear UID: 3816 Current DNS ----------- stest-demo.apps.paas.it is an alias for node1.paas.it. node1.paas.it has address 192.168.110.3 ================================================================================ # rhc app show stest stest @ http://stest-demo.apps.paas.it/ (uuid: 561fd346045486fa5a000002) ------------------------------------------------------------------------ Domain: demo Created: 12:24 PM Gears: 2 (defaults to small) Git URL: ssh://561fd346045486fa5a000002.paas.it/~/git/stest.git/ SSH: 561fd346045486fa5a000002.paas.it Deployment: auto (on git push) haproxy-1.4 (Web Load Balancer) ------------------------------- Gears: Located with php-5.4 php-5.4 (PHP 5.4) ----------------- Scaling: x2 (minimum: 3, maximum: available) on small gears # rhc cartridge-status php-5.4 --app stest RESULT: Application is running Application is running