From 51a225c5d7f7d8655be62cab0e4d677b6839f35a Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 15 Dec 2016 16:32:08 -0500 Subject: [PATCH] Create mechanism for enabling placement-client on subnodes When doing multinode devstack we need a way to specify that we've enabled for the placement service. We use a pseudo service of placement-client for this. Change-Id: I04a655fbc58913b3d607400a7f677be299499142 --- lib/placement | 15 ++++++++------- stack.sh | 10 ++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/placement b/lib/placement index 165c670206..ff630e29d8 100644 --- a/lib/placement +++ b/lib/placement @@ -55,7 +55,7 @@ PLACEMENT_SERVICE_PORT=${PLACEMENT_SERVICE_PORT:-8778} # Test if any placement services are enabled # is_placement_enabled function is_placement_enabled { - [[ ,${ENABLED_SERVICES} =~ ,"placement-" ]] && return 0 + [[ ,${ENABLED_SERVICES} =~ ,"placement-api" ]] && return 0 return 1 } @@ -101,12 +101,7 @@ function _config_placement_apache_wsgi { " -i $placement_api_apache_conf } -# configure_placement() - Set config files, create data dirs, etc -function configure_placement { - if [ "$PLACEMENT_DB_ENABLED" != False ]; then - iniset $PLACEMENT_CONF placement_database connection `database_connection_url placement` - fi - +function configure_placement_nova_compute { iniset $NOVA_CONF placement auth_type "password" iniset $NOVA_CONF placement auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v3" iniset $NOVA_CONF placement username placement @@ -121,7 +116,13 @@ function configure_placement { # established by the nova api. This avoids, for the time, being, # creating redundant configuration items that are just used for # testing. +} +# configure_placement() - Set config files, create data dirs, etc +function configure_placement { + if [ "$PLACEMENT_DB_ENABLED" != False ]; then + iniset $PLACEMENT_CONF placement_database connection `database_connection_url placement` + fi _config_placement_apache_wsgi } diff --git a/stack.sh b/stack.sh index f4bac30dac..1817f61704 100755 --- a/stack.sh +++ b/stack.sh @@ -869,6 +869,16 @@ if is_service_enabled placement; then configure_placement fi +# create a placement-client fake service to know we need to configure +# placement connectivity. We configure the placement service for nova +# if placement-api or placement-client is active, and n-cpu on the +# same box. +if is_service_enabled placement placement-client; then + if is_service_enabled n-cpu; then + configure_placement_nova_compute + fi +fi + if is_service_enabled horizon; then # django openstack_auth install_django_openstack_auth