From e0a678970700785fc2b95c0b3bfe211e600a40d3 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Fri, 8 Dec 2017 13:47:22 +0000 Subject: [PATCH] Run nova online data migration before updating packages Change-Id: I84f68e837a57e895b80fdaecf825e0227be67a37 Closes-bug: 1737175 --- instack_undercloud/undercloud.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index 6e433d7c9..75c2efe55 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -1852,12 +1852,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', '-E', '/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. @@ -1902,6 +1896,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')