Skip to content

Commit 24b58a9

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "nova: call map_cell0 much earlier in the setup"
2 parents 8a82a9d + ac5fdb4 commit 24b58a9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

lib/nova

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,13 @@ function init_nova {
704704
recreate_database nova
705705
recreate_database nova_cell0
706706

707-
# Migrate nova database. If "nova-manage cell_v2 simple_cell_setup" has
708-
# been run this migrates the "nova" and "nova_cell0" database.
709-
# Otherwise it just migrates the "nova" database.
707+
# map_cell0 will create the cell mapping record in the nova_api DB so
708+
# this needs to come after the api_db sync happens. We also want to run
709+
# this before the db sync below since that will migrate both the nova
710+
# and nova_cell0 databases.
711+
nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0`
712+
713+
# Migrate nova and nova_cell0 databases.
710714
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
711715

712716
if is_service_enabled n-cell; then
@@ -966,9 +970,6 @@ function create_flavors {
966970

967971
# create_cell(): Group the available hosts into a cell
968972
function create_cell {
969-
# NOTE(danms): map_cell0 always returns 1 right now; remove this when that is fixed
970-
(nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0`|| true)
971-
972973
if ! is_service_enabled n-cell; then
973974
nova-manage cell_v2 simple_cell_setup --transport-url $(get_transport_url)
974975
else

0 commit comments

Comments
 (0)