Skip to content

Commit 20eeff8

Browse files
committed
Revert "Fleetify nova conductor for N cells"
This reverts commit f63aa02. Change-Id: I541abe7311e5721d79e300fcb2a0b8ffdcd3c015 Related-Bug: #1700364
1 parent f63aa02 commit 20eeff8

2 files changed

Lines changed: 13 additions & 102 deletions

File tree

lib/nova

Lines changed: 12 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,10 @@ NOVA_AUTH_CACHE_DIR=${NOVA_AUTH_CACHE_DIR:-/var/cache/nova}
5353
NOVA_CONF_DIR=/etc/nova
5454
NOVA_CONF=$NOVA_CONF_DIR/nova.conf
5555
NOVA_CELLS_CONF=$NOVA_CONF_DIR/nova-cells.conf
56-
NOVA_CPU_CONF=$NOVA_CONF_DIR/nova-cpu.conf
5756
NOVA_FAKE_CONF=$NOVA_CONF_DIR/nova-fake.conf
5857
NOVA_CELLS_DB=${NOVA_CELLS_DB:-nova_cell}
5958
NOVA_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-
6860
NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini}
6961

7062
if 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

641619
function 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-
658631
function init_nova_cells {
659632
if is_service_enabled n-cell; then
660633
cp $NOVA_CONF $NOVA_CELLS_CONF
@@ -719,6 +692,8 @@ function init_nova {
719692
recreate_database $NOVA_API_DB
720693
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
721694

695+
# (Re)create nova databases
696+
recreate_database nova
722697
recreate_database nova_cell0
723698

724699
# map_cell0 will create the cell mapping record in the nova_api DB so
@@ -730,12 +705,6 @@ function init_nova {
730705
# Migrate nova and nova_cell0 databases.
731706
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
732707

733-
# (Re)create nova databases
734-
for i in $(seq 1 $NOVA_NUM_CELLS); do
735-
recreate_database nova_cell${i}
736-
$NOVA_BIN_DIR/nova-manage --config-file $(conductor_conf $i) db sync
737-
done
738-
739708
if is_service_enabled n-cell; then
740709
recreate_database $NOVA_CELLS_DB
741710
fi
@@ -744,13 +713,9 @@ function init_nova {
744713
# Needed for flavor conversion
745714
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db online_data_migrations
746715

747-
# FIXME(danms): Should this be configurable?
748-
iniset $NOVA_CONF workarounds disable_group_policy_check_upcall True
749-
750716
# create the cell1 cell for the main nova db where the hosts live
751-
for i in $(seq 1 $NOVA_NUM_CELLS); do
752-
nova-manage --config-file $NOVA_CONF --config-file $(conductor_conf $i) cell_v2 create_cell --name "cell$i"
753-
done
717+
nova-manage cell_v2 create_cell --transport-url $(get_transport_url) \
718+
--name 'cell1'
754719
fi
755720

756721
create_nova_cache_dir
@@ -858,38 +823,25 @@ function start_nova_api {
858823

859824
# start_nova_compute() - Start the compute process
860825
function start_nova_compute {
861-
local nomulticellflag="$1"
862826
# Hack to set the path for rootwrap
863827
local old_path=$PATH
864828
export PATH=$NOVA_BIN_DIR:$PATH
865829

866830
if is_service_enabled n-cell; then
867831
local compute_cell_conf=$NOVA_CELLS_CONF
868-
# NOTE(danms): Don't setup conductor fleet for cellsv1
869-
nomulticellflag='nomulticell'
870832
else
871833
local compute_cell_conf=$NOVA_CONF
872834
fi
873835

874-
if [ "$nomulticellflag" = 'nomulticell' ]; then
875-
# NOTE(danms): Grenade doesn't setup multi-cell rabbit, so
876-
# skip these bits and use the normal config.
877-
NOVA_CPU_CONF=$compute_cell_conf
878-
echo "Skipping multi-cell conductor fleet setup"
879-
else
880-
cp $compute_cell_conf $NOVA_CPU_CONF
881-
iniset_rpc_backend nova $NOVA_CPU_CONF DEFAULT "nova_cell${NOVA_CPU_CELL}"
882-
fi
883-
884836
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
885837
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
886838
# ``sg`` is used in run_process to execute nova-compute as a member of the
887839
# **$LIBVIRT_GROUP** group.
888-
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF" $LIBVIRT_GROUP
840+
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf" $LIBVIRT_GROUP
889841
elif [[ "$VIRT_DRIVER" = 'lxd' ]]; then
890-
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF" $LXD_GROUP
842+
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf" $LXD_GROUP
891843
elif [[ "$VIRT_DRIVER" = 'docker' || "$VIRT_DRIVER" = 'zun' ]]; then
892-
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF" $DOCKER_GROUP
844+
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf" $DOCKER_GROUP
893845
elif [[ "$VIRT_DRIVER" = 'fake' ]]; then
894846
local i
895847
for i in `seq 1 $NUMBER_FAKE_NOVA_COMPUTE`; do
@@ -898,13 +850,13 @@ function start_nova_compute {
898850
# gets its own configuration and own log file.
899851
local fake_conf="${NOVA_FAKE_CONF}-${i}"
900852
iniset $fake_conf DEFAULT nhost "${HOSTNAME}${i}"
901-
run_process "n-cpu-${i}" "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF --config-file $fake_conf"
853+
run_process "n-cpu-${i}" "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf --config-file $fake_conf"
902854
done
903855
else
904856
if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
905857
start_nova_hypervisor
906858
fi
907-
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CPU_CONF"
859+
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf"
908860
fi
909861

910862
export PATH=$old_path
@@ -924,6 +876,7 @@ function start_nova_rest {
924876
fi
925877

926878
# ``run_process`` checks ``is_service_enabled``, it is not needed here
879+
run_process n-cond "$NOVA_BIN_DIR/nova-conductor --config-file $compute_cell_conf"
927880
run_process n-cell-region "$NOVA_BIN_DIR/nova-cells --config-file $api_cell_conf"
928881
run_process n-cell-child "$NOVA_BIN_DIR/nova-cells --config-file $compute_cell_conf"
929882

@@ -946,38 +899,8 @@ function start_nova_rest {
946899
export PATH=$old_path
947900
}
948901

949-
function enable_nova_fleet {
950-
if is_service_enabled n-cond; then
951-
enable_service n-super-cond
952-
for i in $(seq 1 $NOVA_NUM_CELLS); do
953-
enable_service n-cond-cell${i}
954-
done
955-
fi
956-
}
957-
958-
function start_nova_conductor {
959-
if is_service_enabled n-cell; then
960-
echo "Starting nova-conductor in a cellsv1-compatible way"
961-
run_process n-cond "$NOVA_BIN_DIR/nova-conductor --config-file $NOVA_CELLS_CONF"
962-
return
963-
fi
964-
965-
enable_nova_fleet
966-
if is_service_enabled n-super-cond; then
967-
run_process n-super-cond "$NOVA_BIN_DIR/nova-conductor --config-file $NOVA_CONF"
968-
fi
969-
for i in $(seq 1 $NOVA_NUM_CELLS); do
970-
if is_service_enabled n-cond-cell${i}; then
971-
local conf
972-
conf=$(conductor_conf $i)
973-
run_process n-cond-cell${i} "$NOVA_BIN_DIR/nova-conductor --config-file $conf"
974-
fi
975-
done
976-
}
977-
978902
function start_nova {
979903
start_nova_rest
980-
start_nova_conductor
981904
start_nova_compute
982905
}
983906

@@ -1006,24 +929,14 @@ function stop_nova_rest {
1006929
# Kill the nova screen windows
1007930
# Some services are listed here twice since more than one instance
1008931
# of a service may be running in certain configs.
1009-
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
932+
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
1010933
stop_process $serv
1011934
done
1012935
}
1013936

1014-
function stop_nova_conductor {
1015-
enable_nova_fleet
1016-
for srv in n-super-cond $(seq -f n-cond-cell%0.f 1 $NOVA_NUM_CELLS); do
1017-
if is_service_enabled $srv; then
1018-
stop_process $srv
1019-
fi
1020-
done
1021-
}
1022-
1023937
# stop_nova() - Stop running processes (non-screen)
1024938
function stop_nova {
1025939
stop_nova_rest
1026-
stop_nova_conductor
1027940
stop_nova_compute
1028941
}
1029942

stack.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,7 @@ fi
12681268
# Unable to use LUKS passphrase that is exactly 16 bytes long
12691269
# https://bugzilla.redhat.com/show_bug.cgi?id=1447297
12701270
if is_service_enabled nova; then
1271-
key=$(generate_hex_string 36)
1272-
iniset $NOVA_CONF key_manager fixed_key "$key"
1273-
iniset $NOVA_CPU_CONF key_manager fixed_key "$key"
1271+
iniset $NOVA_CONF key_manager fixed_key $(generate_hex_string 36)
12741272
fi
12751273

12761274
# Launch the nova-api and wait for it to answer before continuing

0 commit comments

Comments
 (0)