Run cell v2 setup differently for upgrades

For the upgrades from Newton, we need to run the cell v2 simple setup
before running the api db sync since we did not deploy cell v2 in
Newton. Starting with Ocata, api db sync errors if the cell v2 simple
setup has not been done.

Change-Id: I80ecc0943e08952fbc29c55da9d4ba8f51b0eb7e
Closes-Bug: #1649341
This commit is contained in:
Alex Schultz 2017-01-11 13:18:55 -07:00 committed by Emilien Macchi
parent 317db76e01
commit ad47a3c40f
1 changed files with 38 additions and 0 deletions

View File

@ -657,3 +657,41 @@ Service[$needless_services] {
if str2bool(hiera('enable_novajoin', false)) {
include ::nova::metadata::novajoin::api
}
# Upgrade Special Snowflakes
if str2bool($::undercloud_upgrade) {
# NOTE(aschultz): Since we did not deploy cell v2 in newton, we need to be
# able to run the cell v2 setup prior to the api db sync call. This affects
# upgrades only. The normal clean install process requires that the api db
# sync occur prior to the cell v2 simple setup so we have to reorder these
# only for upgrades. See LP#1649341
include ::nova::deps
include ::nova::cell_v2::map_cell_and_hosts
class { '::nova::cell_v2::map_instances':
cell_name => 'default',
}
# NOTE(aschultz): this should pull the cell v2 items out and run them before
# the api db sync.
# The order should be:
# - cell v2 setup
# - db sync
# - cell v2 map cell and hosts
# - cell v2 instances
# - api db sync
Anchor<| title == 'nova::cell_v2::begin' |> {
subscribe => Anchor['nova::db::end']
}
Anchor<| title == 'nova::cell_v2::end' |> {
notify => Anchor['nova::dbsync_api::begin']
}
Anchor<| title == 'nova::dbsync::begin' |> {
subscribe => Anchor['nova::db::end']
}
Class['nova::cell_v2::simple_setup'] ~>
Anchor['nova::dbsync::begin'] ~>
Anchor['nova::dbsync::end'] ~>
Class['nova::cell_v2::map_cell_and_hosts'] ~>
Class['nova::cell_v2::map_instances'] ~>
Anchor['nova::dbsync_api::begin']
}