Fix cellsv2 cell0 database name

For some reason we were defaulting the name of the cell0 database
to nova_api_cell0 instead of nova_cell0. Devstack inherited that to
make things work, but we don't really want that. This patch makes us
use the proper name and create the cell0 mapping accordingly. As a
side effect, it also starts the process of unifying the cellsv1 and
cellsv2 paths by creating the cell0 mapping the same for both.

Conflicts:
        lib/nova

NOTE(mriedem): The conflicts are due to not supporting cells v2
in a cells v1 deployment in Newton and the fact that cells v2
was still optional in Newton (but required in Ocata).

Change-Id: I4e7f6c5eaa068c98e5c4ef3feaee50d8e4f5d484
(cherry picked from commit 29bb53fd3e)
This commit is contained in:
Dan Smith 2017-01-15 09:50:40 -08:00 committed by Matt Riedemann
parent 0e1064d4db
commit 33a218a1e7
1 changed files with 5 additions and 2 deletions

View File

@ -688,11 +688,11 @@ function init_nova {
# (Re)create nova databases
recreate_database nova
if [ "$NOVA_CONFIGURE_CELLSV2" != "False" ]; then
recreate_database nova_api_cell0
recreate_database nova_cell0
fi
# Migrate nova database. If "nova-manage cell_v2 simple_cell_setup" has
# been run this migrates the "nova" and "nova_api_cell0" database.
# been run this migrates the "nova" and "nova_cell0" database.
# Otherwise it just migrates the "nova" database.
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
@ -954,6 +954,9 @@ function create_flavors {
# create_cell(): Group the available hosts into a cell
function create_cell {
# NOTE(danms): map_cell0 always returns 1 right now; remove this when that is fixed
(nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0`|| true)
if ! is_service_enabled n-cell; then
nova-manage cell_v2 simple_cell_setup --transport-url $(get_transport_url)
else