diff --git a/deployment/cinder/cinder-backup-container-puppet.yaml b/deployment/cinder/cinder-backup-container-puppet.yaml index 76525eb01c..e9a2acb554 100644 --- a/deployment/cinder/cinder-backup-container-puppet.yaml +++ b/deployment/cinder/cinder-backup-container-puppet.yaml @@ -247,6 +247,38 @@ outputs: name: virt_sandbox_use_netlink persistent: yes state: yes + deploy_steps_tasks: + - name: Clean up when switching cinder-backup from pcmk to active-active + when: + - step|int == 1 + become: true + block: + - name: Check if cinder-backup is running under pacemaker + command: "pcs status" + register: cinder_backup_pcs_status + check_mode: false + failed_when: false + changed_when: false + + - when: + - '"cinder-backup" in cinder_backup_pcs_status.stdout' + block: + - name: Remove the openstack-cinder-backup pcs resource + pacemaker_resource: + resource: openstack-cinder-backup + state: delete + run_once: true + + - name: Identify the cinder-backup pcmklatest container image + shell: "{{container_cli}} images | awk '$1 ~ \"cinder-backup\" && $2 == \"pcmklatest\" {print $1\":\"$2}'" + register: cinder_backup_pcmklatest_image + check_mode: false + changed_when: false + + - name: Remove the cinder-backup pcmklatest container image + command: "{{container_cli}} rmi {{cinder_backup_pcmklatest_image.stdout}}" + when: + - cinder_backup_pcmklatest_image.stdout|length > 0 external_upgrade_tasks: - when: - step|int == 1 diff --git a/environments/cinder-backup-active-active.yaml b/environments/cinder-backup-active-active.yaml new file mode 100644 index 0000000000..1829af7b2a --- /dev/null +++ b/environments/cinder-backup-active-active.yaml @@ -0,0 +1,2 @@ +resource_registry: + OS::TripleO::Services::CinderBackup: ../deployment/cinder/cinder-backup-container-puppet.yaml diff --git a/environments/cinder-backup.yaml b/environments/cinder-backup.yaml index d8ae01748b..ee144dca42 100644 --- a/environments/cinder-backup.yaml +++ b/environments/cinder-backup.yaml @@ -1,4 +1,3 @@ resource_registry: OS::TripleO::Services::CinderBackup: ../deployment/cinder/cinder-backup-pacemaker-puppet.yaml - # For non-pcmk managed implementation - # OS::TripleO::Services::CinderBackup: ../deployment/cinder/cinder-backup-container-puppet.yaml + # Use cinder-backup-active-active.yaml for non-pcmk managed implementation diff --git a/releasenotes/notes/cinder-backup-active-active-2eb8f8cf612a7989.yaml b/releasenotes/notes/cinder-backup-active-active-2eb8f8cf612a7989.yaml new file mode 100644 index 0000000000..c5fc6ad15a --- /dev/null +++ b/releasenotes/notes/cinder-backup-active-active-2eb8f8cf612a7989.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The Cinder Backup service can be switched from running active/passive + under pacemaker, to active-active mode where it runs simultaneously on + every node on which it's deployed. Note that the service will be restarted + when switching modes, which will interrupt any backup operations currently + in progress.