From 9d115a3595f3ad89ce52a97c350418cab950272a Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Thu, 17 Jan 2019 13:21:18 +0100 Subject: [PATCH] Add support for transferring MariaDB data between nodes Change-Id: I3a1424f5e3f7e52256829c35e3a092f783e18479 Implements: blueprint upgrades-with-os --- docker/services/pacemaker/database/mysql.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml index 14790141ff..cf5486efc3 100644 --- a/docker/services/pacemaker/database/mysql.yaml +++ b/docker/services/pacemaker/database/mysql.yaml @@ -38,6 +38,9 @@ parameters: MysqlUpgradePersist: type: boolean default: false + MysqlUpgradeTransfer: + type: boolean + default: true RoleName: default: '' description: Role name on which the service is applied @@ -541,6 +544,27 @@ outputs: - name: Upgrade Mysql database from the host shell: /bin/bash -ecx "{{mysql_upgrade_script}}" when: not mysql_containerized|bool + external_upgrade_tasks: + - vars: + mysql_upgrade_transfer: {get_param: MysqlUpgradeTransfer} + when: + - step|int == 1 + - mysql_upgrade_transfer + tags: + - never + - system_upgrade_transfer_data + block: + - name: Disable mysql + command: /usr/sbin/pcs resource disable galera-bundle --wait + delegate_to: "{{hostvars[groups['overcloud'][0]]['mysql_short_node_names'][1]}}" + - name: Transfer mysql data + include_role: + name: tripleo-transfer + vars: + tripleo_transfer_src_dir: /var/lib/mysql + tripleo_transfer_src_host: "{{hostvars[groups['overcloud'][0]]['mysql_short_node_names'][1]}}" + tripleo_transfer_dest_dir: /var/lib/mysql + tripleo_transfer_dest_host: "{{hostvars[groups['overcloud'][0]]['mysql_short_bootstrap_node_name']}}" fast_forward_upgrade_tasks: - when: - step|int == 6