Browse code

Merge "nova: call map_cell0 much earlier in the setup"

Jenkins authored on 2017/03/02 03:08:11
Showing 1 changed files
... ...
@@ -704,9 +704,13 @@ function init_nova {
704 704
         recreate_database nova
705 705
         recreate_database nova_cell0
706 706
 
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.
710 714
         $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
711 715
 
712 716
         if is_service_enabled n-cell; then
... ...
@@ -966,9 +970,6 @@ function create_flavors {
966 966
 
967 967
 # create_cell(): Group the available hosts into a cell
968 968
 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
-
972 969
     if ! is_service_enabled n-cell; then
973 970
         nova-manage cell_v2 simple_cell_setup --transport-url $(get_transport_url)
974 971
     else