Skip to content

Commit 5adfef0

Browse files
sdaguekk7ds
authored andcommitted
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
1 parent 4a20320 commit 5adfef0

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

lib/nova

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,16 @@ function create_nova_conf {
432432
# require them running on the host. The ensures that n-cpu doesn't
433433
# leak a need to use the db in a multinode scenario.
434434
if is_service_enabled n-api n-cond n-sched; then
435-
iniset $NOVA_CONF database connection `database_connection_url nova_cell0`
435+
# If we're in multi-tier cells mode, we want our control services pointing
436+
# at cell0 instead of cell1 to ensure isolation. If not, we point everything
437+
# at the main database like normal.
438+
if [[ "$CELLSV2_SETUP" == "singleconductor" ]]; then
439+
local db="nova_cell1"
440+
else
441+
local db="nova_cell0"
442+
fi
443+
444+
iniset $NOVA_CONF database connection `database_connection_url $db`
436445
iniset $NOVA_CONF api_database connection `database_connection_url nova_api`
437446
fi
438447

@@ -676,15 +685,15 @@ function init_nova {
676685
# and nova_cell0 databases.
677686
nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0`
678687

679-
# Migrate nova and nova_cell0 databases.
680-
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
681-
682688
# (Re)create nova databases
683689
for i in $(seq 1 $NOVA_NUM_CELLS); do
684690
recreate_database nova_cell${i}
685691
$NOVA_BIN_DIR/nova-manage --config-file $(conductor_conf $i) db sync
686692
done
687693

694+
# Migrate nova and nova_cell0 databases.
695+
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
696+
688697
if is_service_enabled n-cell; then
689698
recreate_database $NOVA_CELLS_DB
690699
fi
@@ -795,25 +804,25 @@ function start_nova_api {
795804

796805
# start_nova_compute() - Start the compute process
797806
function start_nova_compute {
798-
local nomulticellflag="$1"
799807
# Hack to set the path for rootwrap
800808
local old_path=$PATH
801809
export PATH=$NOVA_BIN_DIR:$PATH
802810

803811
if is_service_enabled n-cell; then
804812
local compute_cell_conf=$NOVA_CELLS_CONF
805813
# NOTE(danms): Don't setup conductor fleet for cellsv1
806-
nomulticellflag='nomulticell'
814+
CELLSV2_SETUP="singleconductor"
807815
else
808816
local compute_cell_conf=$NOVA_CONF
809817
fi
810818

811-
if [ "$nomulticellflag" = 'nomulticell' ]; then
819+
if [[ "${CELLSV2_SETUP}" == "singleconductor" ]]; then
812820
# NOTE(danms): Grenade doesn't setup multi-cell rabbit, so
813821
# skip these bits and use the normal config.
814822
NOVA_CPU_CONF=$compute_cell_conf
815823
echo "Skipping multi-cell conductor fleet setup"
816824
else
825+
# "${CELLSV2_SETUP}" is "superconductor"
817826
cp $compute_cell_conf $NOVA_CPU_CONF
818827
# FIXME(danms): Should this be configurable?
819828
iniset $NOVA_CPU_CONF workarounds disable_group_policy_check_upcall True

stackrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True
7777
# Set the default Nova APIs to enable
7878
NOVA_ENABLED_APIS=osapi_compute,metadata
7979

80+
# CELLSV2_SETUP - how we should configure services with cells v2
81+
#
82+
# - superconductor - this is one conductor for the api services, and
83+
# one per cell managing the compute services. This is prefered
84+
# - singleconductor - this is one conductor for the whole deployment,
85+
# this is not recommended, and will be removed in the future.
86+
CELLSV2_SETUP=${CELLSV2_SETUP:-"superconductor"}
87+
8088
# Set the root URL for Horizon
8189
HORIZON_APACHE_ROOT="/dashboard"
8290

0 commit comments

Comments
 (0)