pcs commands on host: cinder backup/volume

This implements the creation of the haproxy bundle on the host.
The testing protocol used is documented in the depends-on.

The reason for adding a post_update task is that during a minor update
the deployment tasks are not run during the node update procedure but
only during the final converge. So we ran the role again there to make
sure that any config change will trigger a restart during the minor
update, so the disruption is only local to the single node being
updated. If we did not do this a final converge could potentially
trigger a global restart of HA bundles which would be quite disruptive.

Depends-On: Iaa7e89f0d25221c2a6ef0b81eb88a6f496f01696
Change-Id: Ia4399b632257e693fb2c516e487856331149589d
Related-Bug: #1863442
This commit is contained in:
Michele Baldessari 2020-05-01 13:19:58 +02:00 committed by wes hayutin
parent caf1c3d323
commit f37f21f31d
2 changed files with 45 additions and 90 deletions

View File

@ -79,7 +79,6 @@ parameters:
file: /var/log/containers/cinder/cinder-backup.log
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']}
common_tag_enabled: {equals: [{get_param: ClusterCommonTag}, true]}
@ -191,50 +190,6 @@ outputs:
volumes:
- /var/log/containers/cinder:/var/log/cinder:z
command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
step_5:
cinder_backup_init_bundle:
start_order: 0
detach: false
net: host
ipc: host
user: root
command: # '/container_puppet_apply.sh "STEP" "TAGS" "CONFIG" "DEBUG"'
list_concat:
- - '/container_puppet_apply.sh'
- '5'
- 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
- 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::cinder::backup_bundle'
- if:
- puppet_debug_enabled
- - '--debug --verbose'
- - ''
image: {get_param: ContainerCinderBackupImage}
volumes:
list_concat:
- {get_attr: [ContainersCommon, container_puppet_apply_volumes]}
- if:
- docker_enabled
- - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
- null
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
cinder_backup_restart_bundle:
start_order: 1
config_volume: cinder
detach: false
net: host
ipc: host
user: root
environment:
TRIPLEO_MINOR_UPDATE: ''
command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh cinder_backup openstack-cinder-backup openstack-cinder-backup _ Started
image: {get_param: ContainerCinderBackupImage}
volumes:
list_concat:
- {get_attr: [ContainersCommon, pacemaker_restart_volumes]}
- - /var/lib/config-data/puppet-generated/cinder:/var/lib/kolla/config_files/src:ro
host_prep_tasks: {get_attr: [CinderCommon, cinder_backup_host_prep_tasks]}
deploy_steps_tasks:
- name: Cinder Backup tag container image for pacemaker
@ -244,6 +199,22 @@ outputs:
vars:
container_image: {get_param: ContainerCinderBackupImage}
container_image_latest: *cinder_backup_image_pcmklatest
- name: Cinder Backup HA Wrappers Step
when: step|int == 5
block: &cinder_backup_puppet_bundle
- name: Cinder backup puppet bundle
import_role:
name: tripleo_ha_wrapper
vars:
tripleo_ha_wrapper_service_name: cinder_backup
tripleo_ha_wrapper_resource_name: openstack-cinder-backup
tripleo_ha_wrapper_bundle_name: openstack-cinder-backup
tripleo_ha_wrapper_resource_state: _ Started
tripleo_ha_wrapper_puppet_config_volume: cinder
tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::cinder::backup_bundle'
tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug}
update_tasks:
- name: Tear-down non-HA cinder-backup container
when:
@ -281,6 +252,13 @@ outputs:
when:
- old_cinder_backup_image_id.stdout != new_cinder_backup_image_id.stdout
post_update_tasks:
- name: Cinder backup bundle post update
when: step|int == 1
block: *cinder_backup_puppet_bundle
vars:
tripleo_ha_wrapper_minor_update: true
upgrade_tasks:
- name: Tear-down non-HA cinder_backup container
when:

View File

@ -67,7 +67,6 @@ parameters:
file: /var/log/containers/cinder/cinder-volume.log
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']}
common_tag_enabled: {equals: [{get_param: ClusterCommonTag}, true]}
@ -172,50 +171,6 @@ outputs:
volumes:
- /var/log/containers/cinder:/var/log/cinder
command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
step_5:
cinder_volume_init_bundle:
start_order: 0
detach: false
net: host
ipc: host
user: root
command: # '/container_puppet_apply.sh "STEP" "TAGS" "CONFIG" "DEBUG"'
list_concat:
- - '/container_puppet_apply.sh'
- '5'
- 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
- 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::cinder::volume_bundle'
- if:
- puppet_debug_enabled
- - '--debug --verbose'
- - ''
image: {get_param: ContainerCinderVolumeImage}
volumes:
list_concat:
- {get_attr: [ContainersCommon, container_puppet_apply_volumes]}
- if:
- docker_enabled
- - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
- null
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
cinder_volume_restart_bundle:
start_order: 2
config_volume: cinder
detach: false
net: host
ipc: host
user: root
environment:
TRIPLEO_MINOR_UPDATE: ''
command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh cinder_volume openstack-cinder-volume openstack-cinder-volume _ Started
image: {get_param: ContainerCinderVolumeImage}
volumes:
list_concat:
- {get_attr: [ContainersCommon, pacemaker_restart_volumes]}
- - /var/lib/config-data/puppet-generated/cinder:/var/lib/kolla/config_files/src:ro
host_prep_tasks: {get_attr: [CinderCommon, cinder_volume_host_prep_tasks]}
deploy_steps_tasks:
- name: Cinder Volume tag container image for pacemaker
@ -225,6 +180,21 @@ outputs:
vars:
container_image: {get_param: ContainerCinderVolumeImage}
container_image_latest: *cinder_volume_image_pcmklatest
- name: Cinder Volume HA Wrappers Step
when: step|int == 5
block: &cinder_volume_puppet_bundle
- name: Cinder volume puppet bundle
import_role:
name: tripleo_ha_wrapper
vars:
tripleo_ha_wrapper_service_name: cinder_volume
tripleo_ha_wrapper_resource_name: openstack-cinder-volume
tripleo_ha_wrapper_bundle_name: openstack-cinder-volume
tripleo_ha_wrapper_resource_state: _ Started
tripleo_ha_wrapper_puppet_config_volume: cinder
tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::cinder::volume_bundle'
tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug}
update_tasks:
- name: Tear-down non-HA cinder_volume container
@ -263,6 +233,13 @@ outputs:
when:
- old_cinder_volume_image_id.stdout != new_cinder_volume_image_id.stdout
post_update_tasks:
- name: Cinder volume bundle post update
when: step|int == 1
block: *cinder_volume_puppet_bundle
vars:
tripleo_ha_wrapper_minor_update: true
upgrade_tasks:
- name: Tear-down non-HA cinder_volume container
when: