From 5adfef0a53a19436cd759b1d345bcad0a46fc1bf Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 26 Jul 2017 11:14:37 -0400 Subject: [PATCH] Introduce CELLSV2_SETUP variable Some environments, like grenade and ironic, need a way to revert to the non fleet version of the conductor setup. This really comes down to a global topology for CELLSV2_SETUP. The prefered is with a superconductor, but allow a downgrade to singleconductor. Depends-On: I5390ec14c41da0237c898852935aba3569e7acae Change-Id: I10fb048ef2175909019461e585d117b4284448c6 --- lib/nova | 23 ++++++++++++++++------- stackrc | 8 ++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/nova b/lib/nova index 0500fc27a8..5362e3fef4 100644 --- a/lib/nova +++ b/lib/nova @@ -432,7 +432,16 @@ function create_nova_conf { # require them running on the host. The ensures that n-cpu doesn't # leak a need to use the db in a multinode scenario. if is_service_enabled n-api n-cond n-sched; then - iniset $NOVA_CONF database connection `database_connection_url nova_cell0` + # If we're in multi-tier cells mode, we want our control services pointing + # at cell0 instead of cell1 to ensure isolation. If not, we point everything + # at the main database like normal. + if [[ "$CELLSV2_SETUP" == "singleconductor" ]]; then + local db="nova_cell1" + else + local db="nova_cell0" + fi + + iniset $NOVA_CONF database connection `database_connection_url $db` iniset $NOVA_CONF api_database connection `database_connection_url nova_api` fi @@ -676,15 +685,15 @@ function init_nova { # and nova_cell0 databases. nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0` - # Migrate nova and nova_cell0 databases. - $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync - # (Re)create nova databases for i in $(seq 1 $NOVA_NUM_CELLS); do recreate_database nova_cell${i} $NOVA_BIN_DIR/nova-manage --config-file $(conductor_conf $i) db sync done + # Migrate nova and nova_cell0 databases. + $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync + if is_service_enabled n-cell; then recreate_database $NOVA_CELLS_DB fi @@ -795,7 +804,6 @@ function start_nova_api { # start_nova_compute() - Start the compute process function start_nova_compute { - local nomulticellflag="$1" # Hack to set the path for rootwrap local old_path=$PATH export PATH=$NOVA_BIN_DIR:$PATH @@ -803,17 +811,18 @@ function start_nova_compute { if is_service_enabled n-cell; then local compute_cell_conf=$NOVA_CELLS_CONF # NOTE(danms): Don't setup conductor fleet for cellsv1 - nomulticellflag='nomulticell' + CELLSV2_SETUP="singleconductor" else local compute_cell_conf=$NOVA_CONF fi - if [ "$nomulticellflag" = 'nomulticell' ]; then + if [[ "${CELLSV2_SETUP}" == "singleconductor" ]]; then # NOTE(danms): Grenade doesn't setup multi-cell rabbit, so # skip these bits and use the normal config. NOVA_CPU_CONF=$compute_cell_conf echo "Skipping multi-cell conductor fleet setup" else + # "${CELLSV2_SETUP}" is "superconductor" cp $compute_cell_conf $NOVA_CPU_CONF # FIXME(danms): Should this be configurable? iniset $NOVA_CPU_CONF workarounds disable_group_policy_check_upcall True diff --git a/stackrc b/stackrc index e526b548b5..877da82261 100644 --- a/stackrc +++ b/stackrc @@ -77,6 +77,14 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True # Set the default Nova APIs to enable NOVA_ENABLED_APIS=osapi_compute,metadata +# CELLSV2_SETUP - how we should configure services with cells v2 +# +# - superconductor - this is one conductor for the api services, and +# one per cell managing the compute services. This is prefered +# - singleconductor - this is one conductor for the whole deployment, +# this is not recommended, and will be removed in the future. +CELLSV2_SETUP=${CELLSV2_SETUP:-"superconductor"} + # Set the root URL for Horizon HORIZON_APACHE_ROOT="/dashboard"