Run nova online data migration before updating packages

Change-Id: I84f68e837a57e895b80fdaecf825e0227be67a37
Closes-bug: 1737175
(cherry picked from commit e0a6789707)
This commit is contained in:
Oliver Walsh 2017-12-08 13:47:22 +00:00
parent b41bce5dcd
commit 5004fa5c77
1 changed files with 6 additions and 6 deletions

View File

@ -1777,12 +1777,6 @@ def install(instack_root, upgrade=False):
instack_env = _generate_environment(instack_root)
_generate_init_data(instack_env)
if upgrade:
# 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.
_run_command(['sudo', '/usr/bin/nova-manage', 'db',
'online_data_migrations'])
# Even if we backport https://review.openstack.org/#/c/457478/
# into stable branches of puppet-ironic, we still need a way
# to handle existing deployments.
@ -1827,6 +1821,12 @@ def pre_upgrade():
_run_live_command(args, name='systemctl stop')
LOG.info('Services stopped successfully')
# Ensure nova data migrations are complete before upgrading packages
LOG.info('Running Nova online data migration')
_run_command(['sudo', '-E', '/usr/bin/nova-manage', 'db',
'online_data_migrations'])
LOG.info('Nova online data migration completed')
args = ['sudo', 'yum', 'install', '-y', 'ansible-pacemaker']
LOG.info('Installing Ansible Pacemaker module')
_run_live_command(args, name='install ansible')