From d4db2fa532c81c7c7ed13f45cb22d22ed42011bf Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Tue, 13 Aug 2019 13:59:44 +0200 Subject: [PATCH] Force re-run of pacemaker bundle init containers during upgrade-scaleup We need to recreate the *_init_bundle containers during the staged upgrade (upgrade-scaleup), because the init containers will e.g. set the correct replica count for the bundle as we're scaling up from 1 to 3 controllers. The init containers wouldn't get re-run/recreated automatically on upgrade-scaleup because none of their input would change. The DeploymentIdentifier is set by the `openstack upgrade prepare` command and applied during upgrade with `--limit controller-0`. Then later when we run `--limit controller-0,controller-1`, the DeploymentIdentifier value does not change from the perspective of controller-0, so we have to explicitly remove the bundle init containers to force re-running them. Change-Id: I93c6d7292f37529735e24286f4076634aa4fe6a5 Partial-Bug: #1831690 --- deployment/database/mysql-pacemaker-puppet.yaml | 6 ++++++ deployment/database/redis-pacemaker-puppet.yaml | 6 ++++++ deployment/haproxy/haproxy-pacemaker-puppet.yaml | 6 ++++++ .../rabbitmq-messaging-notify-pacemaker-puppet.yaml | 6 ++++++ .../rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml | 6 ++++++ .../rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml | 6 ++++++ 6 files changed, 36 insertions(+) diff --git a/deployment/database/mysql-pacemaker-puppet.yaml b/deployment/database/mysql-pacemaker-puppet.yaml index 2a75795cfd..5f747b2460 100644 --- a/deployment/database/mysql-pacemaker-puppet.yaml +++ b/deployment/database/mysql-pacemaker-puppet.yaml @@ -528,6 +528,12 @@ outputs: mysql_node_names_upgraded is not defined or mysql_node_names_upgraded | length == 0 + - name: remove mysql init container on upgrade-scaleup to force re-init + shell: | + if podman inspect mysql_init_bundle &> /dev/null; then + podman rm mysql_init_bundle + fi + when: mysql_short_node_names_upgraded | length > 1 - name: add the mysql short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index 5af9593e08..250faf6830 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -452,6 +452,12 @@ outputs: redis_short_node_names_upgraded is not defined or redis_short_node_names_upgraded | length == 0 + - name: remove redis init container on upgrade-scaleup to force re-init + shell: | + if podman inspect redis_init_bundle &> /dev/null; then + podman rm redis_init_bundle + fi + when: redis_short_node_names_upgraded | length > 1 - name: add the redis short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera diff --git a/deployment/haproxy/haproxy-pacemaker-puppet.yaml b/deployment/haproxy/haproxy-pacemaker-puppet.yaml index 5577f769d6..0573f390cc 100644 --- a/deployment/haproxy/haproxy-pacemaker-puppet.yaml +++ b/deployment/haproxy/haproxy-pacemaker-puppet.yaml @@ -551,6 +551,12 @@ outputs: haproxy_short_node_names_upgraded is not defined or haproxy_short_node_names_upgraded | length == 0 + - name: remove haproxy init container on upgrade-scaleup to force re-init + shell: | + if podman inspect haproxy_init_bundle &> /dev/null; then + podman rm haproxy_init_bundle + fi + when: haproxy_short_node_names_upgraded | length > 1 - name: add the haproxy short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index 2b0b41d951..19d1636a89 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -421,6 +421,12 @@ outputs: oslo_messaging_notify_node_names_upgraded is not defined or oslo_messaging_notify_node_names_upgraded | length == 0 + - name: remove rabbitmq init container on upgrade-scaleup to force re-init + shell: | + if podman inspect rabbitmq_init_bundle &> /dev/null; then + podman rm rabbitmq_init_bundle + fi + when: oslo_messaging_notify_short_node_names_upgraded | length > 1 - name: add the oslo_messaging_notify short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera diff --git a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml index babba7ec00..8068b53a27 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml @@ -418,6 +418,12 @@ outputs: rabbitmq_short_node_names_upgraded is not defined or rabbitmq_short_node_names_upgraded | length == 0 + - name: remove rabbitmq init container on upgrade-scaleup to force re-init + shell: | + if podman inspect rabbitmq_init_bundle &> /dev/null; then + podman rm rabbitmq_init_bundle + fi + when: rabbitmq_short_node_names_upgraded | length > 1 - name: add the rabbitmq short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index 9cab2c5436..be8d42fc46 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -421,6 +421,12 @@ outputs: oslo_messaging_rpc_node_names_upgraded is not defined or oslo_messaging_rpc_node_names_upgraded | length == 0 + - name: remove rabbitmq init container on upgrade-scaleup to force re-init + shell: | + if podman inspect rabbitmq_init_bundle &> /dev/null; then + podman rm rabbitmq_init_bundle + fi + when: oslo_messaging_rpc_short_node_names_upgraded | length > 1 - name: add the oslo_messaging_rpc short name to hiera data for the upgrade. include_role: name: tripleo-upgrade-hiera