Browse code

Fix DevStack failure in multi-region setting

In stack.sh, REGION_NAME is used to set environment variable
OS_REGION_NAME before using OpenStack client to configure accounts
for services. OpenStack client will try to find Keystone endpoint
in REGION_NAME to send the requests.

However, in the case of deploying multiple DevStack instances in
different regions with shared Keystone, Keystone is only running
in one the of region. When installing DevStack for the region that
does not host Keystone, OpenStack client will fail to find the
Keystone endpoint and thus DevStack fails to start.

This patch fixes this bug by introducing KEYSTONE_REGION_NAME for
user to specify which region Keystone is running in. Document of
multi-region setup is also updated.

Change-Id: I3e82c7ff69326d4171623299ffecea103d40c80d
Closes-Bug: #1540802

zhiyuan_cai authored on 2016/04/07 19:36:46
Showing 3 changed files
... ...
@@ -630,6 +630,16 @@ In RegionTwo:
630 630
     KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
631 631
     KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
632 632
     REGION_NAME=RegionTwo
633
+    KEYSTONE_REGION_NAME=RegionOne
634
+
635
+In the devstack for RegionOne, we set REGION_NAME as RegionOne, so region of
636
+the services started in this devstack are registered as RegionOne. In devstack
637
+for RegionTwo, similarly, we set REGION_NAME as RegionTwo since we want
638
+services started in this devstack to be registered in RegionTwo. But Keystone
639
+service is started and registered in RegionOne, not RegionTwo, so we use
640
+KEYSTONE_REGION_NAME to specify the region of Keystone service.
641
+KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit
642
+it in the configuration of RegionOne.
633 643
 
634 644
 Disabling Identity API v2
635 645
 +++++++++++++++++++++++++
... ...
@@ -1020,7 +1020,7 @@ export OS_USER_DOMAIN_ID=default
1020 1020
 export OS_PASSWORD=$ADMIN_PASSWORD
1021 1021
 export OS_PROJECT_NAME=admin
1022 1022
 export OS_PROJECT_DOMAIN_ID=default
1023
-export OS_REGION_NAME=$REGION_NAME
1023
+export OS_REGION_NAME=$KEYSTONE_REGION_NAME
1024 1024
 
1025 1025
 EOF
1026 1026
 
... ...
@@ -42,6 +42,12 @@ fi
42 42
 # Specify region name Region
43 43
 REGION_NAME=${REGION_NAME:-RegionOne}
44 44
 
45
+# Specify name of region where identity service endpoint is registered.
46
+# When deploying multiple DevStack instances in different regions with shared
47
+# Keystone, set KEYSTONE_REGION_NAME to the region where Keystone is running
48
+# for DevStack instances which do not host Keystone.
49
+KEYSTONE_REGION_NAME=${KEYSTONE_REGION_NAME:-$REGION_NAME}
50
+
45 51
 # Specify which services to launch.  These generally correspond to
46 52
 # screen tabs. To change the default list, use the ``enable_service`` and
47 53
 # ``disable_service`` functions in ``local.conf``.