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 - Gears of one app can be moved to another different region
Summary: Gears of one app can be moved to another different region
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-20 09:12 UTC by Jianwei Hou
Modified: 2015-05-15 00:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-26 19:09:39 UTC


Attachments (Terms of Use)

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):
fork_ami_origin_broker_178_998

How reproducible:
Always

Steps to Reproduce:
1. Create 1 district with 2 regions and 2 zones, the district info is as following:
{"_id"=>"52dccb5f212fd1554e000001",                                                                                                                    
 "active_server_identities_size"=>2,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2014-01-20 07:08:15 UTC,
 "gear_size"=>"small",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"d1",
 "server_identities"=>
  [{"_id"=>"52dcd8a5212fd1cfe8000001",
    "_type"=>"Server",
    "active"=>true,
    "created_at"=>2014-01-20 08:04:53 UTC,
    "name"=>"ip-10-137-4-247",
    "region_id"=>"52dcd7cc212fd1d7bc000001",
    "region_name"=>"r1",
    "unresponsive"=>false,
    "updated_at"=>2014-01-20 08:04:53 UTC,
    "zone_id"=>"52dcd7e2212fd10dce000001",
    "zone_name"=>"z1"},
   {"_id"=>"52dce3fd212fd11bac000001",
    "_type"=>"Server",
    "active"=>true,
    "created_at"=>2014-01-20 08:53:17 UTC,
    "name"=>"ip-10-239-32-71",
    "region_id"=>"52dcd91b212fd14eb5000001",
    "region_name"=>"r2",
    "unresponsive"=>false,
    "updated_at"=>2014-01-20 08:53:17 UTC,
    "zone_id"=>"52dce3c3212fd125ed000001",
    "zone_name"=>"z2"}],
 "updated_at"=>2014-01-20 07:08:15 UTC,
 "uuid"=>"a17be9f081a111e3b17e22000a8904f7"}
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
URL: http://php1s-jhou.dev.rhcloud.com
Login: jhou@redhat.com
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
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
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
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
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 https://github.com/openshift/origin-server/pull/4454

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

Result:
[root@ip-10-235-54-6 openshift]# oo-admin-move --gear_uuid 56cc268c8fd811e39ce622000aeb3606 -i ip-10-29-43-156
URL: http://php1s-jhou.dev.rhcloud.com
Login: jhou@redhat.com
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


Note You need to log in before you can comment on or make changes to this bug.