From f6d566c21d0b33344e58fcbc9ec388d7503570da Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 22 Dec 2017 11:39:29 -0500 Subject: [PATCH] Configure nova_cell1.conf to use placement for reschedules Nova now calculates alternate hosts in the scheduler and sends those to the cell for reschedules in case a build on a given compute node fails. The cell conductor needs to claim resources against the alternate hosts in Placement during a reschedule, therefore it needs to be configured to talk to the placement service. Part of blueprint return-alternate-hosts Change-Id: Ie599968d9e7537e551fe6d9deb63a91b256b1e11 --- lib/nova | 6 ++++++ lib/placement | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/nova b/lib/nova index 50deeeb220..c40c43af6c 100644 --- a/lib/nova +++ b/lib/nova @@ -600,6 +600,12 @@ function create_nova_conf { else rpc_backend_add_vhost $vhost iniset_rpc_backend nova $conf DEFAULT $vhost + # When running in superconductor mode, the cell conductor + # must be configured to talk to the placement service for + # reschedules to work. + if is_service_enabled placement placement-client; then + configure_placement_nova_compute $conf + fi fi # Format logging setup_logging $conf diff --git a/lib/placement b/lib/placement index 1875857552..1d68f8a185 100644 --- a/lib/placement +++ b/lib/placement @@ -103,14 +103,16 @@ function _config_placement_apache_wsgi { } function configure_placement_nova_compute { - iniset $NOVA_CONF placement auth_type "password" - iniset $NOVA_CONF placement auth_url "$KEYSTONE_SERVICE_URI" - iniset $NOVA_CONF placement username placement - iniset $NOVA_CONF placement password "$SERVICE_PASSWORD" - iniset $NOVA_CONF placement user_domain_name "$SERVICE_DOMAIN_NAME" - iniset $NOVA_CONF placement project_name "$SERVICE_TENANT_NAME" - iniset $NOVA_CONF placement project_domain_name "$SERVICE_DOMAIN_NAME" - iniset $NOVA_CONF placement os_region_name "$REGION_NAME" + # 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 os_region_name "$REGION_NAME" # TODO(cdent): auth_strategy, which is common to see in these # blocks is not currently used here. For the time being the # placement api uses the auth_strategy configuration setting