@@ -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
797806function 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
0 commit comments