]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rolling_update: set osd sortbitwise
authorSébastien Han <seb@redhat.com>
Mon, 23 Jul 2018 12:56:20 +0000 (14:56 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 24 Jul 2018 15:19:02 +0000 (17:19 +0200)
upgrade RHCS 2 -> RHCS 3 will fail if cluster has still set
sortnibblewise,
it stay stuck on "TASK [waiting for clean pgs...]" as RHCS 3 osds will
not start if nibblewise is set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1600943
Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 60f76bde696f7d293e07a9dd51eeb0fed6bef5fc..1991ab99f5266403afc68e7431c19f5acf8df08f 100644 (file)
     health_osd_check_retries: 40
     health_osd_check_delay: 30
     upgrade_ceph_packages: True
+    jewel_minor_update: False
 
   hosts:
     - "{{ osd_group_name|default('osds') }}"
       when:
         - containerized_deployment
 
+    - name: get osd versions
+      command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
+      register: ceph_versions
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      when:
+        - not jewel_minor_update
+
+    - name: set_fact ceph_versions_osd
+      set_fact:
+        ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}"
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      when:
+        - not jewel_minor_update
+
+    # length == 1 means there is a single osds versions entry
+    # thus all the osds are running the same version
+    - name: osd set sortbitwise
+      command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd set sortbitwise"
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      when:
+        - (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
+        - ceph_versions_osd | string | search("ceph version 12")
+        - not jewel_minor_update
+
     - name: get num_pgs - non container
       command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} -s --format json"
       register: ceph_pgs