From 71119b47a0e3fb86b349732a1777be8c83d2e6c2 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 15 Aug 2016 12:06:55 -0700 Subject: [PATCH] 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 --- lib/nova | 9 +++++++++ stack.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/nova b/lib/nova index f5a798c923..670f605fd6 100644 --- a/lib/nova +++ b/lib/nova @@ -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 diff --git a/stack.sh b/stack.sh index 1cc4eca1b9..4b071841b8 100755 --- a/stack.sh +++ b/stack.sh @@ -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 # ===============