From 4db5462608380db3bcdf418fcb5a67f05ce69a2e Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 18 Feb 2021 15:02:32 +0100 Subject: [PATCH] pcs commands on host: manila-share MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implements the creation of the manila-share 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. NB: Some conflicts due to context differences Depends-On: Iaa7e89f0d25221c2a6ef0b81eb88a6f496f01696 Depends-On: Ifb81d155cbb4598a311c8e6fe90be951a8e7e656 Change-Id: If5730dba4973a5927c84565b6a65398ea1d7072f Related-Bug: #1863442 (cherry picked from commit a1bee391361cde4345c2b78770865dab0278785e) (cherry picked from commit 06209fa28f35f968235fc96989a333fb950df850↲) --- .../manila/manila-share-pacemaker-puppet.yaml | 67 ++++++------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/deployment/manila/manila-share-pacemaker-puppet.yaml b/deployment/manila/manila-share-pacemaker-puppet.yaml index 32990f9012..0339e86746 100644 --- a/deployment/manila/manila-share-pacemaker-puppet.yaml +++ b/deployment/manila/manila-share-pacemaker-puppet.yaml @@ -62,7 +62,6 @@ parameters: perform configuration on a Heat stack-update. conditions: - puppet_debug_enabled: {get_param: ConfigDebug} docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} common_tag_enabled: {equals: [{get_param: ClusterCommonTag}, true]} @@ -150,50 +149,6 @@ outputs: volumes: - /var/log/containers/manila:/var/log/manila:z command: ['/bin/bash', '-c', 'chown -R manila:manila /var/log/manila'] - step_5: - manila_share_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' - - 'pacemaker_constraint,file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location' - - 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::manila::share_bundle' - - if: - - puppet_debug_enabled - - - '--debug' - - - '' - image: {get_param: ContainerManilaShareImage} - 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} - manila_share_restart_bundle: - start_order: 3 - config_volume: manila - detach: false - net: host - ipc: host - user: root - environment: - TRIPLEO_MINOR_UPDATE: '' - command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh manila_share openstack-manila-share openstack-manila-share _ Started - image: {get_param: ContainerManilaShareImage} - volumes: - list_concat: - - {get_attr: [ContainersCommon, pacemaker_restart_volumes]} - - - /var/lib/config-data/puppet-generated/manila:/var/lib/kolla/config_files/src:ro host_prep_tasks: - name: create persistent directories file: @@ -216,6 +171,21 @@ outputs: vars: container_image: {get_param: ContainerManilaShareImage} container_image_latest: *manila_share_image_pcmklatest + - name: Manila-Share HA Wrappers Step + when: step|int == 5 + block: &manila_share_puppet_bundle + - name: Manila-Share puppet bundle + import_role: + name: tripleo_ha_wrapper + vars: + tripleo_ha_wrapper_service_name: manila_share + tripleo_ha_wrapper_resource_name: openstack-manila-share + tripleo_ha_wrapper_bundle_name: openstack-manila-share + tripleo_ha_wrapper_resource_state: _ Started + tripleo_ha_wrapper_puppet_config_volume: manila + tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::manila::share_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: manila_share fetch and retag container image for pacemaker when: step|int == 2 @@ -246,6 +216,13 @@ outputs: when: - old_manila_share_image_id.stdout != new_manila_share_image_id.stdout + post_update_tasks: + - name: Manila-share bundle post update + when: step|int == 1 + block: *manila_share_puppet_bundle + vars: + tripleo_ha_wrapper_minor_update: true + upgrade_tasks: - name: Prepare switch of manila_share image name when: