Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1256952

Summary: enable-ha not adding 2nd haproxy cartridge to scaled app with 2+ gears
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: DocumentationAssignee: Ashley Hardin <ahardin>
Status: CLOSED CURRENTRELEASE QA Contact: Ryan Howe <rhowe>
Severity: high Docs Contact: Vikram Goyal <vigoyal>
Priority: unspecified    
Version: 2.2.0CC: aos-bugs, bperkins, erich, jokerman, mmccomas, nicholas_schuetz, pep, rhowe, tiwillia, vigoyal
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: 2016-09-08 20:17:22 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1273542    
Attachments:
Description Flags
rhc scale test none

Description Ryan Howe 2015-08-25 20:38:06 UTC
Description of problem:
When application is scaled past 2 gears, enable-ha  does not add  a 2nd haproxy cartridge to the application.  

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


How reproducible:
100%

Steps to Reproduce:
1. rhc app create <cart> <app_name>
2. rhc cartridge scale -a <app_name> --min 2 --max 2
3. rhc app enable-ha

Actual results:

RESULT:
exampleapp is now highly available

- DNS gets updated, HA tag is placed on app
- No 2nd haproxy cart is added, LB configs do not get updated

Expected results:

Application is HA 
DNS updated
2nd haproxy cart is added 
LB configs get updated 
HA tag is placed on app 


Additional info:

Workaround:

- Disable HA with REST API call 
curl -k -X POST https://broker.titan.com/broker/rest/application/GEAR_UUID/events --user XXXX --data-urlencode event=disable-ha

- Scale application to only 1 (gear needs to still be able to scale up)

- rhc app enable-ha <app_name> 


https://github.com/openshift/origin-server/blob/f31fff4750f433d579937ba8401b7e8051a41ae5/controller/app/models/application.rb#L962-L978

https://github.com/openshift/origin-server/blob/f31fff4750f433d579937ba8401b7e8051a41ae5/controller/app/pending_ops_models/make_app_ha_op_group.rb

Comment 5 Ryan Howe 2015-10-27 14:34:24 UTC
Created attachment 1086860 [details]
rhc scale test

Bug123 was scaled then has ha-enabled (test)


Bug456 had ha-enable before scales (control)

Comment 6 Ryan Howe 2015-10-27 14:54:48 UTC
Added attachment 

Application names were bug 123 and bug 456 



The workaround only worked by setting the min higher the 2nd time :


Workaround:
 1. rhc app create <cart> <app_name>
 2. rhc cartridge scale -a <app_name> --min 2 --max 2
 3. rhc app enable-ha
 4. rhc cartridge scale -a <app_name> --min 3 --max 3

or instead of step 4 a scale up event needs to happen for the 2nd haproxy cart to be added.

Comment 18 Ashley Hardin 2016-05-18 13:39:57 UTC
@Ryan, Please review:
http://docbuilder.usersys.redhat.com/22540/#Making_Applications_Highly_Available

Comment 19 Ryan Howe 2016-05-25 19:37:17 UTC
Looks good to me

Comment 20 Ryan Howe 2016-07-15 17:41:00 UTC
LGTM

Comment 21 Ashley Hardin 2016-08-26 20:20:07 UTC
Publishing notes to Alex:

User Guide [22540]
11.7. Making Applications Highly Available
http://docbuilder.usersys.redhat.com/22540/#Making_Applications_Highly_Available