Add a pre-upgrade online_data_migration step for undercloud

A complete upgrade from M->N would require a db sync followed by a
db online_data_migration step after the package upgrades. Because of
the referred bug this however cannot be guaranteed to have happened,
which would result in an upgrade failure when later upgrading from
N->O. Therefore we need to do an additional online_data_migration
before the package upgrades happen, to make sure the subsequent db
sync will not fail.

Related-Bug: #1656791
Change-Id: I87dad6166e335577711ddb02156d7c5146e7ea96
This commit is contained in:
Sven Anderson 2017-01-25 18:57:02 +01:00
parent 7110e24453
commit f4db8c8012
1 changed files with 7 additions and 0 deletions

View File

@ -1303,6 +1303,13 @@ def install(instack_root, upgrade=False):
_validate_configuration()
instack_env = _generate_environment(instack_root)
_generate_init_data(instack_env)
# We didn't complete the M->N upgrades correctly with a
# `nova-manage db online_data_migrations` command before. This could
# cause the post-upgrade db sync to fail. Better be safe than sorry and
# run it before package upgrade.
if upgrade:
_run_command(['sudo', '/usr/bin/nova-manage', 'db',
'online_data_migrations'])
if CONF.undercloud_update_packages:
_run_yum_clean_all(instack_env)
_run_yum_update(instack_env)