From 16a10d7435be54c97982b93bbc07686ebeb536ac Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Mon, 14 Jan 2019 17:16:01 +0000 Subject: [PATCH] Configure nova's use of placement more correctly This change addresses a few inconsistencies in how nova processes are configured to speak to the placement service. The initial inspiration was that region_name was not being set in the [placement] section, despite $REGION_NAME being used when setting the endpoint in the catalog. That's fixed. While fixing that two other issues became clear: * Configuring nova process to use placement should happen in lib/nova not lib/placement so the function has been moved. * auth_strategy is not relevant in the [placement] section of a nova process The name of the function is maintained, in case there are plugins which call it, but a comment is added to indicate that other services besides nova compute (such as the cell conductor) may use the function. Change-Id: I4a46b6460596e9a445bd90de2d52dbb71fb963df --- lib/nova | 15 +++++++++++++++ lib/placement | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/nova b/lib/nova index d1d0b3c16b..182ae1efef 100644 --- a/lib/nova +++ b/lib/nova @@ -597,6 +597,21 @@ function create_nova_conf { fi } +# Configure access to placement from a nova service, usually +# compute, but sometimes conductor. +function configure_placement_nova_compute { + # Use the provided config file path or default to $NOVA_CONF. + local conf=${1:-$NOVA_CONF} + iniset $conf placement auth_type "password" + iniset $conf placement auth_url "$KEYSTONE_SERVICE_URI" + iniset $conf placement username placement + iniset $conf placement password "$SERVICE_PASSWORD" + iniset $conf placement user_domain_name "$SERVICE_DOMAIN_NAME" + iniset $conf placement project_name "$SERVICE_TENANT_NAME" + iniset $conf placement project_domain_name "$SERVICE_DOMAIN_NAME" + iniset $conf placement region_name "$REGION_NAME" +} + function configure_console_compute { # All nova-compute workers need to know the vnc configuration options # These settings don't hurt anything if n-xvnc and n-novnc are disabled diff --git a/lib/placement b/lib/placement index da69e39264..a89cd26939 100644 --- a/lib/placement +++ b/lib/placement @@ -93,19 +93,6 @@ function _config_placement_apache_wsgi { " -i $placement_api_apache_conf } -function configure_placement_nova_compute { - # Use the provided config file path or default to $NOVA_CONF. - local conf=${1:-$NOVA_CONF} - iniset $conf placement auth_type "password" - iniset $conf placement auth_url "$KEYSTONE_SERVICE_URI" - iniset $conf placement username placement - iniset $conf placement password "$SERVICE_PASSWORD" - iniset $conf placement user_domain_name "$SERVICE_DOMAIN_NAME" - iniset $conf placement project_name "$SERVICE_TENANT_NAME" - iniset $conf placement project_domain_name "$SERVICE_DOMAIN_NAME" - iniset $conf placement auth_strategy $PLACEMENT_AUTH_STRATEGY -} - # create_placement_conf() - Write config function create_placement_conf { rm -f $PLACEMENT_CONF