Bug 1012297

Summary: oo-admin-ctl-app can not remove scaled-up gears with gear_uuid
Product: OpenShift Online Reporter: Qiushui Zhang <qiuzhang>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: xtian
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-10-17 13:31:38 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:
Attachments:
Description Flags
log from instance none

Description Qiushui Zhang 2013-09-26 08:44:03 UTC
Created attachment 803279 [details]
log from instance

Description of problem:
Scale up an scalable app. Try to remove the scaled gear with "oo-admin-ctl-app -c remove-gear -l qiuzhang -a php1s --gear_uuid 5243ed4cfefcc4095d000014"
. The command returns successfully. But the gear is not removed.

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

How reproducible:
always

Steps to Reproduce:
1. Create an scalable app, with some add-on cartridge
e.g rhc app create php1s php-5.3 mysql-5.1 mongodb-2.2 postgresql-8.4 -s

2. Add disable_auto_scaling marker to the app. Git push the change

3. Scale up the app
curl -k -H "Accept: application/xml" --user qiuzhang:redhat https://ec2-54-226-197-118.compute-1.amazonaws.com/broker/rest/domains/qiuzhang/applications/php1s/events -d event=scale-up -X POST

4. Check the gears
[walter@dhcp-10-238 tmp]$ rhc app show php1s --gears
ID                               State   Cartridges          Size  SSH URL
-------------------------------- ------- ------------------- ----- ------------------------------------------------------------------------------------------
e1a3b550267d11e3a91322000ab93a8e started mongodb-2.2         small e1a3b550267d11e3a91322000ab93a8e.rhcloud.com
537523819696914446680064         started postgresql-8.4      small 537523819696914446680064.rhcloud.com
5243e32ffefcc464f50000df         started php-5.3 haproxy-1.4 small 5243e32ffefcc464f50000df.rhcloud.com
5243ed4cfefcc4095d000014         started php-5.3 haproxy-1.4 small 5243ed4cfefcc4095d000014.rhcloud.com

5. On instance, try to remove the scaled gear
oo-admin-ctl-app -c remove-gear -l qiuzhang -a php1s --gear_uuid 5243ed4cfefcc4095d000014

Actual results:
The command returns "Success". But if checking the gear list, we will find that the gear is not removed.

walter@dhcp-10-238 tmp]$ rash php1s --gears
ID                               State   Cartridges          Size  SSH URL
-------------------------------- ------- ------------------- ----- ------------------------------------------------------------------------------------------
e1a3b550267d11e3a91322000ab93a8e started mongodb-2.2         small e1a3b550267d11e3a91322000ab93a8e.rhcloud.com
537523819696914446680064         started postgresql-8.4      small 537523819696914446680064.rhcloud.com
5243e32ffefcc464f50000df         started php-5.3 haproxy-1.4 small 5243e32ffefcc464f50000df.rhcloud.com
5243ed4cfefcc4095d000014         started php-5.3 haproxy-1.4 small 5243ed4cfefcc4095d000014.rhcloud.com


Expected results:
The gear should be removed, since it is not a database gear or the last web gear.

Additional info:

Comment 1 Ravi Sankar 2013-09-26 23:36:06 UTC
Fixed in https://github.com/openshift/origin-server/pull/3716

Comment 2 openshift-github-bot 2013-09-28 00:46:58 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b45f4ba794762d8474bc26180b786934b3a44cab
Bug 1012297 - Pass gear_id instead of gear_uuid to application remove_gear()

Comment 3 Qiushui Zhang 2013-09-30 02:22:36 UTC
Tested on devenv_3844.

Now the gear can be removed with "--gear_uuid" option.

[root@ip-10-184-54-37 ~]# oo-admin-ctl-app -c remove-gear -l qiuzhang -a php1s --gear_uuid b3d45364297511e38d2222000ab83625
Success
[root@ip-10-184-54-37 ~]# ll /var/lib/openshift/
total 4
drwxr-x---. 14 root 5248ddbe9a73acc911000007 4096 Sep 29 22:11 5248ddbe9a73acc911000007
-rw-r--r--.  1 root root                        0 Sep 29 22:00 last_access.log
lrwxrwxrwx.  1 root root                       24 Sep 29 22:11 php1s-qiuzhang -> 5248ddbe9a73acc911000007
[root@ip-10-184-54-37 ~]#

Mark the bug as verified.