Run online data migration before update/upgrade converge.

Some services have an online component to their upgrade
procedure – operations which don’t induce downtime and
can run while the cloud operates normally.

Change-Id: I9b0bef15303bb14ef734b265f28607aa4d491910
(cherry picked from commit 43cc0dbec2)
This commit is contained in:
Yurii Prokulevych 2018-11-20 09:04:36 +01:00
parent c02dcb765b
commit ae0fc106a8
5 changed files with 46 additions and 0 deletions

View File

@ -54,6 +54,13 @@
with_items:
- "{{ oc_roles|default('all') }}"
- name: create online data migration script
template:
src: "overcloud_online_data_migration.sh.j2"
dest: "{{ working_dir }}/overcloud_online_data_migration.sh"
mode: 0755
force: true
- name: create overcloud update converge script
template:
src: "{{ overcloud_update_converge_template }}"

View File

@ -99,6 +99,13 @@
include: ceph_update_run.yml
when: ceph_osd_enabled|bool
- name: run online data migration
args:
chdir: "{{working_dir}}"
shell: |
set -o pipefail
bash {{ working_dir }}/overcloud_online_data_migration.sh 2>&1 {{ timestamper_cmd }} > overcloud_update_data_migration.log
- name: apply pre overcloud update converge workarounds
command: "{{working_dir}}/pre_overcloud_update_converge_workarounds.sh"
when: updates_workarounds

View File

@ -70,6 +70,13 @@
with_items:
- "{{ oc_roles|default('all') }}"
- name: create online data migration script
template:
src: "overcloud_online_data_migration.sh.j2"
dest: "{{ working_dir }}/overcloud_online_data_migration.sh"
mode: 0755
force: true
- name: create overcloud converge script
vars:
old_img: "{{ working_dir }}/{{ container_registry_file }}"

View File

@ -136,6 +136,13 @@
chdir: "{{working_dir}}"
when: upgrade_workarounds
- name: run online data migration
args:
chdir: "{{working_dir}}"
shell: |
set -o pipefail
bash {{ working_dir }}/overcloud_online_data_migration.sh 2>&1 {{ timestamper_cmd }} > overcloud_upgrade_data_migration.log
- include: overcloud_upgrade_converge.yml
tags: overcloud_upgrade_converge

View File

@ -0,0 +1,18 @@
#!/bin/env bash
#
# Run online data migration for OpenStack services
#
{% if overcloud_update|bool -%}
{% set operation_type = 'update' -%}
{% elif overcloud_upgrade|bool -%}
{% set operation_type = 'upgrade' -%}
{% endif -%}
set -euo pipefail
source {{ undercloud_rc }}
echo "[$(date)] Run online data migration for overcloud during {{ operation_type }}"
openstack overcloud external-{{ operation_type }} run \
--stack {{ overcloud_stack_name }} \
--tags online_upgrade 2>&1