Bug 1006645

Summary: Web cartridge's min gears can grow greater than max gears after enabling HA
Product: OpenShift Online Reporter: Jianwei Hou <jhou>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rchopra
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-19 16:50:46 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 Jianwei Hou 2013-09-11 02:39:30 UTC
Description of problem:
Setting a scalable app's both min and max gears to 1, then enable HA, the min grows to 2, and max remains 1.

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

How reproducible:
Always

Steps to Reproduce:
1. Enable HA in OpenShift config, and grant user with ha capability 
2. Create a scalable php application, set min/max gears to 1
rhc create-app php1s php-5.3 -s
rhc cartridge-scale php-5.3 -a php1s --min 1 --max 1
3. Enable HA
curl -s -k -H 'Content-Type: Application/json' --user jhou:xx https://ec2-54-224-30-93.compute-1.amazonaws.com/broker/rest/domains/jhou/applications//events -X POST -d '{"event":"make-ha"}'

Actual results:
Got response
<snip>
"messages": [
        {
            "exit_code": 0,
            "field": null,
            "severity": "info",
            "text": "Application php1s is now ha"
        }
</snip>

0 % rhc app-show php1s
Please sign in to start a new session to ec2-54-224-30-93.compute-1.amazonaws.com.
Password: 

php1s @ http://php1s-jhou.dev.rhcloud.com/ (uuid: 522fcfaad31d694e3100005a)
---------------------------------------------------------------------------
  Domain:  jhou
  Created: 10:04 AM
  Gears:   2 (defaults to small)
  Git URL: ssh://522fcfaad31d694e3100005a.rhcloud.com/~/git/php1s.git/
  SSH:     522fcfaad31d694e3100005a.rhcloud.com

  php-5.3 (PHP 5.3)
  -----------------
    Scaling: x2 (minimum: 2, maximum: 1) on small gears

  haproxy-1.4 (OpenShift Web Balancer)
  ------------------------------------
    Gears: Located with php-5.3


Expected results:
Should disallow setting ha

Additional info:

Comment 1 Rajat Chopra 2013-09-11 04:22:15 UTC
Fixed with https://github.com/openshift/origin-server/pull/3615

Comment 2 Jianwei Hou 2013-09-12 02:14:27 UTC
Verified on devenv_3776

1. Enable HA in OpenShift config, and grant user with ha capability 
2. Create a scalable php application, set min/max gears to 1
rhc create-app php1s php-5.3 -s
rhc cartridge-scale php-5.3 -a php1s --min 1 --max 1
3. Enable HA
curl -s -k -H 'Content-Type: Application/json' --user openshift+migration1:XXX https://ec2-54-243-9-104.compute-1.amazonaws.com/broker/rest/domains/jhou/applications/php1s/events -X POST -d '{"event":"make-ha"}'

Result:
{
    "api_version": 1.6,
    "data": null,
    "messages": [
        {
            "exit_code": null,
            "field": null,
            "severity": "error",
            "text": "Cannot make the application HA because the web cartridge's max gear limit is '1'"
        }
    ],
    "status": "unprocessable_entity",
    "supported_api_versions": [
        1.0,
        1.1,
        1.2,
        1.3,
        1.4,
        1.5,
        1.6
    ],
    "type": null,
    "version": "1.6"
}