Support removing cinder-backup from pcmk control

TripleO traditionally deploys the cinder-backup service to run
A/P (active/passive) under pacemaker, but cinder itself supports
running A/A. This patch adds deploy_steps_tasks to remove the
service from pcmk control (essentially deleting the pcs resource)
prior to deploying it as a regular containerized (non-pcmk) service.

A new cinder-backup-active-active.yaml environment file helps the
user clarify their intent. The legacy cinder-backup.yaml file
continues to deploy the service under pacemaker (to preserve the
default deployment behavior), but rather than encouraging users to
edit the file to switch deployment modes (as a comment in the file
used to advise), users can proactively deploy the A/A mode (or switch
from A/P to A/A) by including the new environment file.

Change-Id: Ic94025f51083da77f4ba6ee934ebcf32bcb9909f
This commit is contained in:
Alan Bishop 2021-04-16 07:38:59 -07:00
parent 52fe1cf70c
commit f08ed8036b
4 changed files with 43 additions and 2 deletions

View File

@ -215,6 +215,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

View File

@ -0,0 +1,2 @@
resource_registry:
OS::TripleO::Services::CinderBackup: ../deployment/cinder/cinder-backup-container-puppet.yaml

View File

@ -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

View File

@ -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.