From 1019c7bf2595919c89d33d94d8e86c746aaaa3c6 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 20 Oct 2021 10:01:05 +0200 Subject: [PATCH] update: support upgrading a subset of nodes It can be useful in a large cluster deployment to split the upgrade and only upgrade a group of nodes at a time. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2014304 Signed-off-by: Guillaume Abrioux (cherry picked from commit e5cf9db2b04f55196d867f5a7248b455307f4407) --- infrastructure-playbooks/rolling_update.yml | 32 +++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 30e0862f51..1708835555 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -16,6 +16,7 @@ - name: confirm whether user really meant to upgrade the cluster hosts: localhost + tags: always become: false gather_facts: false vars: @@ -39,7 +40,6 @@ - name: gather facts and check the init system - hosts: - "{{ mon_group_name|default('mons') }}" - "{{ osd_group_name|default('osds') }}" @@ -51,7 +51,7 @@ - "{{ client_group_name|default('clients') }}" - "{{ iscsi_gw_group_name|default('iscsigws') }}" - "{{ grafana_server_group_name|default('grafana-server') }}" - + tags: always any_errors_fatal: True become: True gather_facts: False @@ -128,6 +128,7 @@ rolling_update: true - name: upgrade ceph mon cluster + tags: mons vars: health_mon_check_retries: 5 health_mon_check_delay: 15 @@ -307,6 +308,7 @@ - name: reset mon_host hosts: "{{ mon_group_name|default('mons') }}" + tags: always become: True gather_facts: false tasks: @@ -324,6 +326,7 @@ health_mon_check_delay: 15 upgrade_ceph_packages: True hosts: "{{ mon_group_name|default('mons') }}" + tags: mgrs serial: 1 become: True gather_facts: false @@ -359,6 +362,7 @@ upgrade_ceph_packages: True ceph_release: "{{ ceph_stable_release }}" hosts: "{{ mgr_group_name|default('mgrs') }}" + tags: mgrs serial: 1 become: True gather_facts: false @@ -394,6 +398,7 @@ - name: set osd flags hosts: "{{ mon_group_name | default('mons') }}[0]" + tags: osds become: True gather_facts: false tasks: @@ -455,8 +460,8 @@ health_osd_check_retries: 40 health_osd_check_delay: 30 upgrade_ceph_packages: True - hosts: "{{ osd_group_name|default('osds') }}" + tags: osds serial: 1 become: True gather_facts: false @@ -538,6 +543,7 @@ - name: complete osd upgrade hosts: "{{ mon_group_name|default('mons') }}[0]" + tags: osds become: True gather_facts: false tasks: @@ -579,6 +585,7 @@ - name: upgrade ceph mdss cluster, deactivate all rank > 0 hosts: "{{ mon_group_name | default('mons') }}[0]" + tags: mdss become: true gather_facts: false tasks: @@ -680,6 +687,7 @@ vars: upgrade_ceph_packages: True hosts: active_mdss + tags: mdss become: true gather_facts: false tasks: @@ -726,6 +734,7 @@ vars: upgrade_ceph_packages: True hosts: standby_mdss + tags: mdss become: True gather_facts: false @@ -774,6 +783,7 @@ vars: upgrade_ceph_packages: True hosts: "{{ rgw_group_name|default('rgws') }}" + tags: rgws serial: 1 become: True gather_facts: false @@ -818,6 +828,7 @@ vars: upgrade_ceph_packages: True hosts: "{{ rbdmirror_group_name|default('rbdmirrors') }}" + tags: rbdmirrors serial: 1 become: True gather_facts: false @@ -851,6 +862,7 @@ vars: upgrade_ceph_packages: True hosts: "{{ nfs_group_name|default('nfss') }}" + tags: nfss serial: 1 become: True gather_facts: false @@ -899,8 +911,8 @@ - name: upgrade ceph iscsi gateway node vars: upgrade_ceph_packages: True - hosts: - - "{{ iscsi_gw_group_name|default('iscsigws') }}" + hosts: "{{ iscsi_gw_group_name|default('iscsigws') }}" + tags: iscsigws serial: 1 become: True gather_facts: false @@ -942,6 +954,7 @@ vars: upgrade_ceph_packages: True hosts: "{{ client_group_name|default('clients') }}" + tags: clients serial: "{{ client_update_batch | default(20) }}" become: True gather_facts: false @@ -973,6 +986,9 @@ - "{{ rgw_group_name | default('rgws') }}" - "{{ rbdmirror_group_name | default('rbdmirrors') }}" - "{{ mgr_group_name | default('mgrs') }}" + tags: + - post_upgrade + - crash gather_facts: false become: true tasks: @@ -1009,6 +1025,7 @@ - "{{ rbdmirror_group_name | default('rbdmirrors') }}" - "{{ client_group_name | default('clients') }}" - "{{ iscsi_gw_group_name | default('iscsigws') }}" + tags: post_upgrade become: True gather_facts: false tasks: @@ -1068,6 +1085,7 @@ - "{{ nfs_group_name|default('nfss') }}" - "{{ iscsi_gw_group_name|default('iscsigws') }}" - "{{ grafana_server_group_name|default('grafana-server') }}" + tags: monitoring gather_facts: false become: true tasks: @@ -1098,6 +1116,7 @@ - name: upgrade monitoring node hosts: "{{ grafana_server_group_name }}" + tags: monitoring gather_facts: false become: true tasks: @@ -1129,6 +1148,7 @@ - name: upgrade ceph dashboard hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}" + tags: monitoring gather_facts: false become: true tasks: @@ -1148,6 +1168,7 @@ - name: switch any existing crush buckets to straw2 hosts: "{{ mon_group_name | default('mons') }}[0]" + tags: post_upgrade become: true any_errors_fatal: true gather_facts: false @@ -1189,6 +1210,7 @@ - name: show ceph status hosts: "{{ mon_group_name|default('mons') }}" + tags: always become: True gather_facts: false tasks: