]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
upgrade: block upgrade when rgw multisite is active
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 18 Mar 2022 12:41:17 +0000 (13:41 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 21 Mar 2022 10:39:58 +0000 (11:39 +0100)
With this commit, upgrading a cluster from Nautilus to Pacific with
active rgw multisite replication will be blocked.
This is because a lot of bugs are currently present in Pacific regarding
RGW multisite.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2063702
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 51bc8cb63642b5b1ca460e79adf4649d92773aa4)
(cherry picked from commit f7b7ba30d9680af3058afbd81290243f81bd3998)

infrastructure-playbooks/rolling_update.yml

index 38fc9c4b7437627263a8081e340277bf1f81b36f..dbadc3a1bcccde6a6ce170e367be7d4d5dedda6d 100644 (file)
       import_role:
         name: ceph-defaults
 
-    - name: block upgrade for RHCS deployments with RGW multisite
-      fail:
-        msg: "Red Hat Ceph Storage upgrade with RGW multisite deployed isn't allowed with this release."
-      when:
-        - rgw_multisite | bool
-        - not qe_testing | default(False) | bool
-
     - name: exit playbook, if user did not mean to upgrade cluster
       fail:
         msg: >
     - import_role:
         name: ceph-facts
 
+    - name: block upgrade when rgw-multisite is active
+      when:
+        - groups.get(rgw_group_name, []) | length > 0
+        - not qe_testing | default(False) | bool
+      block:
+        - name: block upgrade for RHCS deployments with RGW multisite
+          fail:
+            msg: "This release of Red Hat Ceph Storage doesn't allow upgrading with rgw multisite."
+          when:
+            - rgw_multisite | bool
+
+        - name: set_fact radosgw_cmd
+          set_fact:
+            radosgw_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:z -v /var/run/ceph:/var/run/ceph:z --entrypoint=radosgw-admin ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'radosgw-admin' }}"
+
+        - name: get list of realms
+          command: "{{ radosgw_cmd }} --cluster {{ cluster }} realm list"
+          register: period_output
+          changed_when: false
+          run_once: true
+          delegate_to: "{{ groups[mon_group_name][0] }}"
+
+        - name: set_fact realms
+          set_fact:
+            realms: "{{ (period_output.stdout | default('{}') | from_json)['realms'] }}"
+          run_once: true
+
+        - name: get the periods
+          command: "{{ radosgw_cmd }} --cluster {{ cluster }} --rgw-realm={{ item }} period get"
+          register: period_list
+          changed_when: false
+          run_once: true
+          delegate_to: "{{ groups[mon_group_name][0] }}"
+          loop: "{{ realms }}"
+
+        - name: set_fact periods
+          set_fact:
+            periods: "{{ periods | default([]) | union([(item.stdout | default('{}') | from_json)['period_map']['zonegroups']]) }}"
+          loop: "{{ period_list.results }}"
+          run_once: true
+
+        - name: fail if there is more than 1 zonegroup per realm (rgw multisite)
+          fail:
+            msg: "This release of Red Hat Ceph Storage doesn't allow upgrading with rgw multisite."
+          when:
+            - periods is defined
+            - periods | map(attribute='name') | list | length != periods | length
+          run_once: true
+
+        - name: fail if at least 1 zonegroup has more than 1 zone (rgw multisite)
+          fail:
+            msg: "This release of Red Hat Ceph Storage doesn't allow upgrading with rgw multisite."
+          loop: "{{ periods }}"
+          run_once: true
+          when:
+            - periods is defined
+            - periods | map(attribute='name') | list | length == periods | length
+            - item[0]['zones'] | length > 1
+
     - import_role:
         name: ceph-infra