Setup cellsv2 for Nova

This patch setup cellsv2 for Nova after plugin initialization phase.
Since this requires compute hosts to be started, we need to do it
after we have initialized all other plugins. Things like ironic
aren't setup when we were running this as part of nova setup, and
thus this command can fail.

When cellsv1 is used (n-cell is enabled) skip calling
cells_v2 simple_cell_setup, which will never have hosts
at the top level and which will always fail.

Change-Id: Ic7d0115da51d6ea17ee49071af259a7789c62ab9
Depends-On: I9bbaa4c92503222c9fd015fe075926b50f3dcc8c
This commit is contained in:
Dan Smith 2016-08-15 12:06:55 -07:00 committed by Sean Dague
parent 6930ba312f
commit 71119b47a0
2 changed files with 17 additions and 0 deletions

@ -946,6 +946,15 @@ function create_flavors {
fi
}
# create_cell(): Group the available hosts into a cell
function create_cell {
if ! is_service_enabled n-cell; then
nova-manage cell_v2 simple_cell_setup --transport-url $(get_transport_url)
else
echo 'Skipping cellsv2 setup for this cellsv1 configuration'
fi
}
# Restore xtrace
$_XTRACE_LIB_NOVA

@ -1379,6 +1379,14 @@ service_check
check_libs_from_git
# Configure nova cellsv2
# ----------------------
# Do this late because it requires compute hosts to have started
if is_service_enabled n-api && [ "$NOVA_CONFIGURE_CELLSV2" == "True" ]; then
create_cell
fi
# Bash completion
# ===============