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
This commit is contained in:
Sean Dague 2017-07-26 11:14:37 -04:00 committed by Dan Smith
parent 4a20320452
commit 5adfef0a53
2 changed files with 24 additions and 7 deletions

View File

@ -432,7 +432,16 @@ function create_nova_conf {
# require them running on the host. The ensures that n-cpu doesn't # require them running on the host. The ensures that n-cpu doesn't
# leak a need to use the db in a multinode scenario. # leak a need to use the db in a multinode scenario.
if is_service_enabled n-api n-cond n-sched; then 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` iniset $NOVA_CONF api_database connection `database_connection_url nova_api`
fi fi
@ -676,15 +685,15 @@ function init_nova {
# and nova_cell0 databases. # and nova_cell0 databases.
nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0` 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 # (Re)create nova databases
for i in $(seq 1 $NOVA_NUM_CELLS); do for i in $(seq 1 $NOVA_NUM_CELLS); do
recreate_database nova_cell${i} recreate_database nova_cell${i}
$NOVA_BIN_DIR/nova-manage --config-file $(conductor_conf $i) db sync $NOVA_BIN_DIR/nova-manage --config-file $(conductor_conf $i) db sync
done 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 if is_service_enabled n-cell; then
recreate_database $NOVA_CELLS_DB recreate_database $NOVA_CELLS_DB
fi fi
@ -795,7 +804,6 @@ function start_nova_api {
# start_nova_compute() - Start the compute process # start_nova_compute() - Start the compute process
function start_nova_compute { function start_nova_compute {
local nomulticellflag="$1"
# Hack to set the path for rootwrap # Hack to set the path for rootwrap
local old_path=$PATH local old_path=$PATH
export PATH=$NOVA_BIN_DIR:$PATH export PATH=$NOVA_BIN_DIR:$PATH
@ -803,17 +811,18 @@ function start_nova_compute {
if is_service_enabled n-cell; then if is_service_enabled n-cell; then
local compute_cell_conf=$NOVA_CELLS_CONF local compute_cell_conf=$NOVA_CELLS_CONF
# NOTE(danms): Don't setup conductor fleet for cellsv1 # NOTE(danms): Don't setup conductor fleet for cellsv1
nomulticellflag='nomulticell' CELLSV2_SETUP="singleconductor"
else else
local compute_cell_conf=$NOVA_CONF local compute_cell_conf=$NOVA_CONF
fi fi
if [ "$nomulticellflag" = 'nomulticell' ]; then if [[ "${CELLSV2_SETUP}" == "singleconductor" ]]; then
# NOTE(danms): Grenade doesn't setup multi-cell rabbit, so # NOTE(danms): Grenade doesn't setup multi-cell rabbit, so
# skip these bits and use the normal config. # skip these bits and use the normal config.
NOVA_CPU_CONF=$compute_cell_conf NOVA_CPU_CONF=$compute_cell_conf
echo "Skipping multi-cell conductor fleet setup" echo "Skipping multi-cell conductor fleet setup"
else else
# "${CELLSV2_SETUP}" is "superconductor"
cp $compute_cell_conf $NOVA_CPU_CONF cp $compute_cell_conf $NOVA_CPU_CONF
# FIXME(danms): Should this be configurable? # FIXME(danms): Should this be configurable?
iniset $NOVA_CPU_CONF workarounds disable_group_policy_check_upcall True iniset $NOVA_CPU_CONF workarounds disable_group_policy_check_upcall True

View File

@ -77,6 +77,14 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True
# Set the default Nova APIs to enable # Set the default Nova APIs to enable
NOVA_ENABLED_APIS=osapi_compute,metadata 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 # Set the root URL for Horizon
HORIZON_APACHE_ROOT="/dashboard" HORIZON_APACHE_ROOT="/dashboard"