From bdf742d05f90a57fdd08e73409d417bfcffdb8ab Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 29 Jul 2019 17:02:03 +0200 Subject: [PATCH] Fix pcmk remote podman bundle restarts We blindly bind mount /etc/corosync/corosync.conf from the host to the container as that is required by pcs when running on pacemaker nodes when using pcs 0.9/pcmk 1.x. When running on a pacemaker remote node, this will actually barf on it because that file does not exist on a remote node: "stderr: error checking path \"/etc/corosync/corosync.conf\": stat /etc/corosync/corosync.conf: no such file or directory", This is not an issue with docker because docker simply creates non existing host bind mount points. So we should not bind mount this when we run podman because podman and HA only works on RHEL/CentOS 8 and it is not required there. Tested this on an Stein deployment with RHEL8 as OS and I correctly get a composable HA environment using pacemaker remote: overcloud-database-0 (ocf::pacemaker:remote): Started overcloud-controller-0 overcloud-database-1 (ocf::pacemaker:remote): Started overcloud-controller-1 overcloud-database-2 (ocf::pacemaker:remote): Started overcloud-controller-2 overcloud-messaging-0 (ocf::pacemaker:remote): Started overcloud-controller-0 overcloud-messaging-1 (ocf::pacemaker:remote): Started overcloud-controller-1 overcloud-messaging-2 (ocf::pacemaker:remote): Started overcloud-controller-2 podman container set: galera-bundle [192.168.24.1:8787/rhosp15/openstack-mariadb:pcmklatest] galera-bundle-0 (ocf::heartbeat:galera): Master overcloud-database-0 galera-bundle-1 (ocf::heartbeat:galera): Master overcloud-database-1 galera-bundle-2 (ocf::heartbeat:galera): Master overcloud-database-2 podman container set: redis-bundle [192.168.24.1:8787/rhosp15/openstack-redis:pcmklatest] redis-bundle-0 (ocf::heartbeat:redis): Master overcloud-controller-0 redis-bundle-1 (ocf::heartbeat:redis): Slave overcloud-controller-1 redis-bundle-2 (ocf::heartbeat:redis): Slave overcloud-controller-2 podman container set: rabbitmq-bundle [192.168.24.1:8787/rhosp15/openstack-rabbitmq:pcmklatest] rabbitmq-bundle-0 (ocf::heartbeat:rabbitmq-cluster): Started overcloud-messaging-0 rabbitmq-bundle-1 (ocf::heartbeat:rabbitmq-cluster): Started overcloud-messaging-1 rabbitmq-bundle-2 (ocf::heartbeat:rabbitmq-cluster): Started overcloud-messaging-2 ip-192.168.24.12 (ocf::heartbeat:IPaddr2): Started overcloud-controller-0 ip-10.0.0.106 (ocf::heartbeat:IPaddr2): Started overcloud-controller-1 ip-172.17.1.68 (ocf::heartbeat:IPaddr2): Started overcloud-controller-2 ip-172.17.1.89 (ocf::heartbeat:IPaddr2): Started overcloud-controller-0 ip-172.17.3.23 (ocf::heartbeat:IPaddr2): Started overcloud-controller-1 ip-172.17.4.41 (ocf::heartbeat:IPaddr2): Started overcloud-controller-2 podman container set: haproxy-bundle [192.168.24.1:8787/rhosp15/openstack-haproxy:pcmklatest] haproxy-bundle-podman-0 (ocf::heartbeat:podman): Started overcloud-controller-0 haproxy-bundle-podman-1 (ocf::heartbeat:podman): Started overcloud-controller-1 haproxy-bundle-podman-2 (ocf::heartbeat:podman): Started overcloud-controller-2 podman container set: ovn-dbs-bundle [192.168.24.1:8787/rhosp15/openstack-ovn-northd:pcmklatest] ovn-dbs-bundle-0 (ocf::ovn:ovndb-servers): Master overcloud-controller-0 ovn-dbs-bundle-1 (ocf::ovn:ovndb-servers): Slave overcloud-controller-1 ovn-dbs-bundle-2 (ocf::ovn:ovndb-servers): Slave overcloud-controller-2 stonith-fence_ipmilan-5254008aa119 (stonith:fence_ipmilan): Started overcloud-controller-0 stonith-fence_ipmilan-5254003d74a4 (stonith:fence_ipmilan): Started overcloud-controller-0 stonith-fence_ipmilan-525400092968 (stonith:fence_ipmilan): Started overcloud-controller-1 stonith-fence_ipmilan-525400439c7e (stonith:fence_ipmilan): Started overcloud-controller-0 stonith-fence_ipmilan-5254002beafa (stonith:fence_ipmilan): Started overcloud-controller-2 stonith-fence_ipmilan-525400bbb6cb (stonith:fence_ipmilan): Started overcloud-controller-1 stonith-fence_ipmilan-5254001b9a8f (stonith:fence_ipmilan): Started overcloud-controller-2 stonith-fence_ipmilan-525400367613 (stonith:fence_ipmilan): Started overcloud-controller-1 stonith-fence_ipmilan-525400150f28 (stonith:fence_ipmilan): Started overcloud-controller-2 podman container: openstack-cinder-volume [192.168.24.1:8787/rhosp15/openstack-cinder-volume:pcmklatest] openstack-cinder-volume-podman-0 (ocf::heartbeat:podman): Started overcloud-controller-0 Closes-Bug: #1838279 Change-Id: I399098bf734aa3b2862e1713d4b1f429d180afbc --- .../cinder/cinder-backup-pacemaker-puppet.yaml | 11 +++++++++-- .../cinder/cinder-volume-pacemaker-puppet.yaml | 11 +++++++++-- deployment/database/mysql-pacemaker-puppet.yaml | 13 ++++++++++--- deployment/database/redis-pacemaker-puppet.yaml | 11 +++++++++-- deployment/haproxy/haproxy-pacemaker-puppet.yaml | 12 +++++++++--- .../manila/manila-share-pacemaker-puppet.yaml | 11 +++++++++-- deployment/ovn/ovn-dbs-pacemaker-puppet.yaml | 12 +++++++++--- .../rabbitmq-messaging-notify-pacemaker-puppet.yaml | 13 ++++++++++--- .../rabbitmq-messaging-pacemaker-puppet.yaml | 13 ++++++++++--- .../rabbitmq-messaging-rpc-pacemaker-puppet.yaml | 13 ++++++++++--- 10 files changed, 94 insertions(+), 26 deletions(-) diff --git a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml index 95db4a3707..3d5e110a05 100644 --- a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml @@ -77,6 +77,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -199,8 +200,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null cinder_backup_init_bundle: start_order: 1 detach: false @@ -221,7 +225,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml index 755b0ce6fd..996f8b5c97 100644 --- a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml @@ -65,6 +65,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -184,8 +185,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null cinder_volume_init_bundle: start_order: 1 detach: false @@ -206,7 +210,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/database/mysql-pacemaker-puppet.yaml b/deployment/database/mysql-pacemaker-puppet.yaml index 0c0bd370be..52bf5fbee6 100644 --- a/deployment/database/mysql-pacemaker-puppet.yaml +++ b/deployment/database/mysql-pacemaker-puppet.yaml @@ -97,6 +97,7 @@ resources: conditions: puppet_debug_enabled: {get_param: ConfigDebug} internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} outputs: role_data: @@ -283,8 +284,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/mysql/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null mysql_init_bundle: start_order: 1 detach: false @@ -305,9 +309,12 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - /var/lib/mysql:/var/lib/mysql:rw,z + - - /var/lib/mysql:/var/lib/mysql:rw,z - /var/lib/config-data/puppet-generated/mysql/root:/root:rw + - 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.) diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index fa426aa87e..5610ebbcb2 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -69,6 +69,7 @@ conditions: puppet_debug_enabled: {get_param: ConfigDebug} internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} redis_ipv6: {get_param: RedisIPv6} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -231,8 +232,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/redis/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null - redis_init_bundle: start_order: 2 detach: false @@ -254,7 +258,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/haproxy/haproxy-pacemaker-puppet.yaml b/deployment/haproxy/haproxy-pacemaker-puppet.yaml index 6fb6be07cc..18385945a9 100644 --- a/deployment/haproxy/haproxy-pacemaker-puppet.yaml +++ b/deployment/haproxy/haproxy-pacemaker-puppet.yaml @@ -114,6 +114,7 @@ conditions: - {get_param: PublicSSLCertificateAutogenerated} - true internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -250,8 +251,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/haproxy/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null haproxy_init_bundle: start_order: 3 detach: false @@ -274,8 +278,10 @@ outputs: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - *deployed_cert_mount - - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/manila/manila-share-pacemaker-puppet.yaml b/deployment/manila/manila-share-pacemaker-puppet.yaml index 681f10d592..8c206ee365 100644 --- a/deployment/manila/manila-share-pacemaker-puppet.yaml +++ b/deployment/manila/manila-share-pacemaker-puppet.yaml @@ -60,6 +60,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -165,8 +166,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/manila/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null manila_share_init_bundle: start_order: 1 detach: false @@ -187,7 +191,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml index 7223f4f717..902d10e7bd 100644 --- a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml +++ b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml @@ -68,6 +68,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -157,8 +158,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null ovn_dbs_init_bundle: start_order: 1 detach: false @@ -180,7 +183,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - 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.) diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index cd52f4225a..1b234b60f1 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -64,6 +64,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -206,8 +207,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/rabbitmq/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null rabbitmq_init_bundle: start_order: 1 detach: false @@ -228,8 +232,11 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - /bin/true:/bin/epmd + - - /bin/true:/bin/epmd + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null environment: # https://launchpad.net/bugs/1822673 (lang/lc_all to utf-8 are an elixir requirement) - 'LANG=en_US.UTF-8' diff --git a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml index 74d77b9d01..d3cd5d498a 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml @@ -64,6 +64,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -206,8 +207,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/rabbitmq/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null rabbitmq_init_bundle: start_order: 1 detach: false @@ -228,8 +232,11 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - /bin/true:/bin/epmd + - - /bin/true:/bin/epmd + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null environment: # https://launchpad.net/bugs/1822673 (lang/lc_all to utf-8 are an elixir requirement) - 'LANG=en_US.UTF-8' diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index bd35bd8125..5045ddc6d6 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -64,6 +64,7 @@ parameters: conditions: puppet_debug_enabled: {get_param: ConfigDebug} + docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} resources: @@ -206,8 +207,11 @@ outputs: list_concat: - {get_attr: [ContainersCommon, volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - /var/lib/config-data/puppet-generated/rabbitmq/:/var/lib/kolla/config_files/src:ro + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null rabbitmq_init_bundle: start_order: 1 detach: false @@ -228,8 +232,11 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, container_puppet_apply_volumes]} - - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro - - /bin/true:/bin/epmd + - - /bin/true:/bin/epmd + - if: + - docker_enabled + - - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro + - null environment: # https://launchpad.net/bugs/1822673 (lang/lc_all to utf-8 are an elixir requirement) - 'LANG=en_US.UTF-8'