Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1055433

Summary: Gears of one app can be moved to another different region
Product: OpenShift Online Reporter: Jianwei Hou <jhou>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-26 19:09:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jianwei Hou 2014-01-20 09:12:11 UTC
Description of problem:
Given there is a scalable app with multiple gears, move one of the gears to another node of another region, the gear was moved successfully. However, this violates the rule that all gears of an app should be in a same region.

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

How reproducible:

Steps to Reproduce:
1. Create 1 district with 2 regions and 2 zones, the district info is as following:
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2014-01-20 07:08:15 UTC,
    "created_at"=>2014-01-20 08:04:53 UTC,
    "updated_at"=>2014-01-20 08:04:53 UTC,
    "created_at"=>2014-01-20 08:53:17 UTC,
    "updated_at"=>2014-01-20 08:53:17 UTC,
 "updated_at"=>2014-01-20 07:08:15 UTC,
2. Create a scalable php-5.3 app with mongodb added, both 2 gears are on a same node after creation.(node ip-10-239-32-71)
3. Try to move 1 gear to another node which was in a different region
oo-admin-move --gear_uuid 52dce40a212fd178ce0000b8 -i ip-10-137-4-247

Actual results:
After step 3, move was successful. But the 2 gears of this app are in different regions now.

[root@ip-10-137-4-247 ~]# oo-admin-move --gear_uuid 52dce40a212fd178ce0000b8 -i ip-10-137-4-247
App UUID: 52dce40a212fd178ce0000b8
Gear UUID: 52dce40a212fd178ce0000b8
DEBUG: Source district uuid: a17be9f081a111e3b17e22000a8904f7
DEBUG: Destination district uuid: a17be9f081a111e3b17e22000a8904f7
DEBUG: Getting existing app 'php1s' status before moving
DEBUG: Gear component 'php-5.3' was running
DEBUG: Stopping existing app cartridge 'php-5.3' before moving
DEBUG: Force stopping existing app cartridge 'php-5.3' before moving
DEBUG: Stopping existing app cartridge 'haproxy-1.4' before moving
DEBUG: Creating new account for gear 'php1s' on ip-10-137-4-247
DEBUG: Moving content for app 'php1s', gear 'php1s' to ip-10-137-4-247
Identity added: /var/www/openshift/broker/config/keys/rsync_id_rsa (/var/www/openshift/broker/config/keys/rsync_id_rsa)
Agent pid 28569
echo Agent pid 28569 killed;
DEBUG: Moving system components for app 'php1s', gear 'php1s' to ip-10-137-4-247
Identity added: /var/www/openshift/broker/config/keys/rsync_id_rsa (/var/www/openshift/broker/config/keys/rsync_id_rsa)
Agent pid 28630
echo Agent pid 28630 killed;
DEBUG: Starting cartridge 'php-5.3' in 'php1s' after move on ip-10-137-4-247
DEBUG: Starting cartridge 'haproxy-1.4' in 'php1s' after move on ip-10-137-4-247
DEBUG: Fixing DNS and mongo for gear 'php1s' after move
DEBUG: Changing server identity of 'php1s' from 'ip-10-239-32-71' to 'ip-10-137-4-247'
DEBUG: Deconfiguring old app 'php1s' on ip-10-239-32-71 after move
Successfully moved gear with uuid '52dce40a212fd178ce0000b8' of app 'php1s' from 'ip-10-239-32-71' to 'ip-10-137-4-247'

Expected results:
Should fail, the target server is in another region.

Additional info:

Comment 1 Ravi Sankar 2014-02-06 23:27:52 UTC
Fixed in

Comment 2 Jianwei Hou 2014-02-07 09:24:34 UTC
Verified on devenv_4343

1. Create 1 district with two nodes, each node belong to a different region
2. Create a scalable app, add mysql
3. Move the mysql gear from current node to the other node

[root@ip-10-235-54-6 openshift]# oo-admin-move --gear_uuid 56cc268c8fd811e39ce622000aeb3606 -i ip-10-29-43-156
App UUID: 52f4a3f1b50b8834d4000029
Gear UUID: 52f4a41cb50b8834d400004a
DEBUG: Source district uuid: 52f49842b50b8819df000001
DEBUG: Destination district uuid: 52f49842b50b8819df000001
Error moving gear. Old and new servers must belong to the same region, source region: region_1 destination region: region_2