@@ -53,18 +53,10 @@ NOVA_AUTH_CACHE_DIR=${NOVA_AUTH_CACHE_DIR:-/var/cache/nova}
5353NOVA_CONF_DIR=/etc/nova
5454NOVA_CONF=$NOVA_CONF_DIR /nova.conf
5555NOVA_CELLS_CONF=$NOVA_CONF_DIR /nova-cells.conf
56- NOVA_CPU_CONF=$NOVA_CONF_DIR /nova-cpu.conf
5756NOVA_FAKE_CONF=$NOVA_CONF_DIR /nova-fake.conf
5857NOVA_CELLS_DB=${NOVA_CELLS_DB:- nova_cell}
5958NOVA_API_DB=${NOVA_API_DB:- nova_api}
6059
61- # The total number of cells we expect. Must be greater than one and doesn't
62- # count cell0.
63- NOVA_NUM_CELLS=${NOVA_NUM_CELLS:- 1}
64- # Our cell index, so we know what rabbit vhost to connect to.
65- # This should be in the range of 1-$NOVA_NUM_CELLS
66- NOVA_CPU_CELL=${NOVA_CPU_CELL:- 1}
67-
6860NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:- $NOVA_CONF_DIR / api-paste.ini}
6961
7062if is_suse; then
@@ -487,7 +479,7 @@ function create_nova_conf {
487479 # require them running on the host. The ensures that n-cpu doesn't
488480 # leak a need to use the db in a multinode scenario.
489481 if is_service_enabled n-api n-cond n-sched; then
490- iniset $NOVA_CONF database connection ` database_connection_url nova_cell0 `
482+ iniset $NOVA_CONF database connection ` database_connection_url nova `
491483 iniset $NOVA_CONF api_database connection ` database_connection_url nova_api`
492484 fi
493485
@@ -622,20 +614,6 @@ function create_nova_conf {
622614 if [ " $NOVA_USE_SERVICE_TOKEN " == " True" ]; then
623615 init_nova_service_user_conf
624616 fi
625-
626- if is_service_enabled n-cond; then
627- for i in $( seq 1 $NOVA_NUM_CELLS ) ; do
628- local conf
629- local vhost
630- conf=$( conductor_conf $i )
631- vhost=" nova_cell${i} "
632- iniset $conf database connection ` database_connection_url nova_cell${i} `
633- iniset $conf conductor workers " $API_WORKERS "
634- iniset $conf DEFAULT debug " $ENABLE_DEBUG_LOG_LEVEL "
635- rpc_backend_add_vhost $vhost
636- iniset_rpc_backend nova $conf DEFAULT $vhost
637- done
638- fi
639617}
640618
641619function init_nova_service_user_conf {
@@ -650,11 +628,6 @@ function init_nova_service_user_conf {
650628 iniset $NOVA_CONF service_user auth_strategy keystone
651629}
652630
653- function conductor_conf {
654- local cell=" $1 "
655- echo " ${NOVA_CONF_DIR} /nova_cell${cell} .conf"
656- }
657-
658631function init_nova_cells {
659632 if is_service_enabled n-cell; then
660633 cp $NOVA_CONF $NOVA_CELLS_CONF
@@ -721,6 +694,8 @@ function init_nova {
721694 recreate_database $NOVA_API_DB
722695 $NOVA_BIN_DIR /nova-manage --config-file $NOVA_CONF api_db sync
723696
697+ # (Re)create nova databases
698+ recreate_database nova
724699 recreate_database nova_cell0
725700
726701 # map_cell0 will create the cell mapping record in the nova_api DB so
@@ -732,12 +707,6 @@ function init_nova {
732707 # Migrate nova and nova_cell0 databases.
733708 $NOVA_BIN_DIR /nova-manage --config-file $NOVA_CONF db sync
734709
735- # (Re)create nova databases
736- for i in $( seq 1 $NOVA_NUM_CELLS ) ; do
737- recreate_database nova_cell${i}
738- $NOVA_BIN_DIR /nova-manage --config-file $( conductor_conf $i ) db sync
739- done
740-
741710 if is_service_enabled n-cell; then
742711 recreate_database $NOVA_CELLS_DB
743712 fi
@@ -746,13 +715,9 @@ function init_nova {
746715 # Needed for flavor conversion
747716 $NOVA_BIN_DIR /nova-manage --config-file $NOVA_CONF db online_data_migrations
748717
749- # FIXME(danms): Should this be configurable?
750- iniset $NOVA_CONF workarounds disable_group_policy_check_upcall True
751-
752718 # create the cell1 cell for the main nova db where the hosts live
753- for i in $( seq 1 $NOVA_NUM_CELLS ) ; do
754- nova-manage --config-file $NOVA_CONF --config-file $( conductor_conf $i ) cell_v2 create_cell --name " cell$i "
755- done
719+ nova-manage cell_v2 create_cell --transport-url $( get_transport_url) \
720+ --name ' cell1'
756721 fi
757722
758723 create_nova_cache_dir
@@ -860,38 +825,25 @@ function start_nova_api {
860825
861826# start_nova_compute() - Start the compute process
862827function start_nova_compute {
863- local nomulticellflag=" $1 "
864828 # Hack to set the path for rootwrap
865829 local old_path=$PATH
866830 export PATH=$NOVA_BIN_DIR :$PATH
867831
868832 if is_service_enabled n-cell; then
869833 local compute_cell_conf=$NOVA_CELLS_CONF
870- # NOTE(danms): Don't setup conductor fleet for cellsv1
871- nomulticellflag=' nomulticell'
872834 else
873835 local compute_cell_conf=$NOVA_CONF
874836 fi
875837
876- if [ " $nomulticellflag " = ' nomulticell' ]; then
877- # NOTE(danms): Grenade doesn't setup multi-cell rabbit, so
878- # skip these bits and use the normal config.
879- NOVA_CPU_CONF=$compute_cell_conf
880- echo " Skipping multi-cell conductor fleet setup"
881- else
882- cp $compute_cell_conf $NOVA_CPU_CONF
883- iniset_rpc_backend nova $NOVA_CPU_CONF DEFAULT " nova_cell${NOVA_CPU_CELL} "
884- fi
885-
886838 if [[ " $VIRT_DRIVER " = ' libvirt' ]]; then
887839 # The group **$LIBVIRT_GROUP** is added to the current user in this script.
888840 # ``sg`` is used in run_process to execute nova-compute as a member of the
889841 # **$LIBVIRT_GROUP** group.
890- run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $NOVA_CPU_CONF " $LIBVIRT_GROUP
842+ run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $compute_cell_conf " $LIBVIRT_GROUP
891843 elif [[ " $VIRT_DRIVER " = ' lxd' ]]; then
892- run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $NOVA_CPU_CONF " $LXD_GROUP
844+ run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $compute_cell_conf " $LXD_GROUP
893845 elif [[ " $VIRT_DRIVER " = ' docker' || " $VIRT_DRIVER " = ' zun' ]]; then
894- run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $NOVA_CPU_CONF " $DOCKER_GROUP
846+ run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $compute_cell_conf " $DOCKER_GROUP
895847 elif [[ " $VIRT_DRIVER " = ' fake' ]]; then
896848 local i
897849 for i in ` seq 1 $NUMBER_FAKE_NOVA_COMPUTE ` ; do
@@ -900,13 +852,13 @@ function start_nova_compute {
900852 # gets its own configuration and own log file.
901853 local fake_conf=" ${NOVA_FAKE_CONF} -${i} "
902854 iniset $fake_conf DEFAULT nhost " ${HOSTNAME}${i} "
903- run_process " n-cpu-${i} " " $NOVA_BIN_DIR /nova-compute --config-file $NOVA_CPU_CONF --config-file $fake_conf "
855+ run_process " n-cpu-${i} " " $NOVA_BIN_DIR /nova-compute --config-file $compute_cell_conf --config-file $fake_conf "
904856 done
905857 else
906858 if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS /hypervisor-$VIRT_DRIVER ]]; then
907859 start_nova_hypervisor
908860 fi
909- run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $NOVA_CPU_CONF "
861+ run_process n-cpu " $NOVA_BIN_DIR /nova-compute --config-file $compute_cell_conf "
910862 fi
911863
912864 export PATH=$old_path
@@ -926,6 +878,7 @@ function start_nova_rest {
926878 fi
927879
928880 # ``run_process`` checks ``is_service_enabled``, it is not needed here
881+ run_process n-cond " $NOVA_BIN_DIR /nova-conductor --config-file $compute_cell_conf "
929882 run_process n-cell-region " $NOVA_BIN_DIR /nova-cells --config-file $api_cell_conf "
930883 run_process n-cell-child " $NOVA_BIN_DIR /nova-cells --config-file $compute_cell_conf "
931884
@@ -948,38 +901,8 @@ function start_nova_rest {
948901 export PATH=$old_path
949902}
950903
951- function enable_nova_fleet {
952- if is_service_enabled n-cond; then
953- enable_service n-super-cond
954- for i in $( seq 1 $NOVA_NUM_CELLS ) ; do
955- enable_service n-cond-cell${i}
956- done
957- fi
958- }
959-
960- function start_nova_conductor {
961- if is_service_enabled n-cell; then
962- echo " Starting nova-conductor in a cellsv1-compatible way"
963- run_process n-cond " $NOVA_BIN_DIR /nova-conductor --config-file $NOVA_CELLS_CONF "
964- return
965- fi
966-
967- enable_nova_fleet
968- if is_service_enabled n-super-cond; then
969- run_process n-super-cond " $NOVA_BIN_DIR /nova-conductor --config-file $NOVA_CONF "
970- fi
971- for i in $( seq 1 $NOVA_NUM_CELLS ) ; do
972- if is_service_enabled n-cond-cell${i} ; then
973- local conf
974- conf=$( conductor_conf $i )
975- run_process n-cond-cell${i} " $NOVA_BIN_DIR /nova-conductor --config-file $conf "
976- fi
977- done
978- }
979-
980904function start_nova {
981905 start_nova_rest
982- start_nova_conductor
983906 start_nova_compute
984907}
985908
@@ -1008,24 +931,14 @@ function stop_nova_rest {
1008931 # Kill the nova screen windows
1009932 # Some services are listed here twice since more than one instance
1010933 # of a service may be running in certain configs.
1011- for serv in n-api n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cell n-cell n-api-meta n-sproxy; do
934+ for serv in n-api n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n- cell n-cell n-api-meta n-sproxy; do
1012935 stop_process $serv
1013936 done
1014937}
1015938
1016- function stop_nova_conductor {
1017- enable_nova_fleet
1018- for srv in n-super-cond $( seq -f n-cond-cell%0.f 1 $NOVA_NUM_CELLS ) ; do
1019- if is_service_enabled $srv ; then
1020- stop_process $srv
1021- fi
1022- done
1023- }
1024-
1025939# stop_nova() - Stop running processes (non-screen)
1026940function stop_nova {
1027941 stop_nova_rest
1028- stop_nova_conductor
1029942 stop_nova_compute
1030943}
1031944
0 commit comments