Bug 1151548

Summary: Console failed to add restricted gear size cartridge to scalable app with different gear size.
Product: OpenShift Online Reporter: Luke Meyer <lmeyer>
Component: Management ConsoleAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jokerman, libra-bugs, libra-onpremise-devel, lmeyer, mmccomas, wsun, xtian, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1150971 Environment:
Last Closed: 2015-03-05 19:56:26 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: 1150971    

Description Luke Meyer 2014-10-10 16:07:15 UTC
To sum up: when using the console, don't have the ability to select a gear size for an add-on cart. When add-on carts are restricted in gear size so that the app's gear size isn't allowed, can't add the cart at all.

+++ This bug was initially created as a clone of Bug #1150971 +++

Description of problem:
Console failed to add restricted gear size cartridge to scalable app with different gear size. 
When set VALID_GEAR_SIZES_FOR_CARTRIDGE="mysql-5.1|small" in broker.conf.
There is no choose button for gear size with mysql-5.1 on website, it use the app's gear size by default, so it failed when add mysql-5.1 to scalable medium size app.The expected action is that mysql-5.1 uses the gear size of ifself.

Steps to Reproduce:
1.The user has allowed gear sizes with small and medium. Configure in broker.conf with:VALID_GEAR_SIZES_FOR_CARTRIDGE="mysql-5.1|small"
Restart services:
# /etc/init.d/openshift-console restart
# /etc/init.d/openshift-broker restart
2.Create medium size scalable app on website,eg sphp54.
3.Add mysql-5.1 to the app sphp54 on website.
4.Add mysql-5.1 to the app sphp54 with rhc.

Actual results:
2.Succeeded.
3.Failed with info:
The cartridge, mysql-5.1, cannot run on a gear with size: medium. Per configuration, the cartridge can only run on the following gear sizes: small.
4.
$ rhc cartridge add mysql-5.1 -a sphp54 -g small
Adding mysql-5.1 to application 'sphp54' ... done

mysql-5.1 (MySQL 5.1)
---------------------
  Gears:          1 small
  Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
  Database Name:  sphp54
  Password:       Xadr8XbR7-Bv
  Username:       admindY1xGGl

MySQL 5.1 database added.  Please make note of these credentials:

       Root User: admindY1xGGl
   Root Password: Xadr8XbR7-Bv
   Database Name: sphp54

Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/

$ rhc app show sphp54 --gears
ID                       State   Cartridges          Size   SSH URL
------------------------ ------- ------------------- ------ --------------------------------------------------------------------------
54364c9282611da321000091 started php-5.4 haproxy-1.4 medium 54364c9282611da321000091.com.cn
543657f882611df693000025 started mysql-5.1           small  543657f882611df693000025.com.cn


Expected results:
3.Should add mysql-5.1 successfully.

Comment 2 Fabiano Franz 2014-10-13 19:54:29 UTC
Fixed in https://github.com/openshift/origin-server/pull/5870

Comment 3 Yujie Zhang 2014-10-14 05:24:51 UTC
Will verify this bug after the code is merged.

Comment 4 Yujie Zhang 2014-10-16 02:44:44 UTC
Assign it back since the pull request has failed.

Comment 5 openshift-github-bot 2014-10-16 05:25:06 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/c2d34126849bb4c3bef936a6e3d07d07f92cb89a
Bug 1151548 - adding cartridge must send supported gear size

Comment 6 Yujie Zhang 2014-10-16 08:29:03 UTC
Move it to on qa since the fix has been merged.

Comment 7 Yujie Zhang 2014-10-16 08:30:57 UTC
Tested on devenv_5235, with setting VALID_GEAR_SIZES_FOR_CARTRIDGE="mysql-5.1|small" in broker-dev.conf, scalable application still can add mysql-5.1 with medium gear successfully, so verify this bug, thanks.