From: Guillaume Abrioux Date: Mon, 18 Nov 2019 16:59:56 +0000 (+0100) Subject: update: use flags noout and nodeep-scrub only X-Git-Tag: v4.0.8~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6e47e96a023f08e577372316ce482ff9e8aa9fa6;p=ceph-ansible.git update: use flags noout and nodeep-scrub only 1. set noout and nodeep-scrub flags, 2. upgrade each OSD node, one by one, wait for active+clean pgs 3. after all osd nodes are upgraded, unset flags Signed-off-by: Guillaume Abrioux Co-authored-by: Rachana Patel (cherry picked from commit 548db78b9535348dff616665be749503f80c4fca) --- diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index a604459b9..0544ab147 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -369,6 +369,21 @@ name: ceph-mgr +- name: set osd flags + hosts: "{{ mon_group_name | default('mons') }}[0]" + become: True + tasks: + - import_role: + name: ceph-defaults + - import_role: + name: ceph-facts + + - name: set osd flags + command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set {{ item }}" + with_items: + - noout + - nodeep-scrub + - name: upgrade ceph osds cluster vars: health_osd_check_retries: 40 @@ -396,6 +411,11 @@ num_osds: "{{ osd_names.stdout_lines|default([])|length }}" when: containerized_deployment | bool + - name: set_fact container_exec_cmd_osd + set_fact: + container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}" + when: containerized_deployment | bool + - name: stop ceph osd systemd: name: ceph-osd@{{ item }} @@ -468,30 +488,6 @@ - ceph_release in ["nautilus", "octopus"] - not containerized_deployment | bool - - name: set_fact container_exec_cmd_osd - set_fact: - container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}" - when: containerized_deployment | bool - - - name: get osd versions - command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions" - register: ceph_versions - delegate_to: "{{ groups[mon_group_name][0] }}" - - - name: set_fact ceph_versions_osd - set_fact: - ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}" - delegate_to: "{{ groups[mon_group_name][0] }}" - - # length == 1 means there is a single osds versions entry - # thus all the osds are running the same version - - name: osd set sortbitwise - command: "{{ container_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 is search("ceph version 10") - - name: get num_pgs - non container command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} -s --format json" register: ceph_pgs @@ -528,11 +524,10 @@ when: containerized_deployment | bool - name: unset osd flags - command: "{{ container_exec_cmd_update_osd|default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}" + command: "{{ container_exec_cmd_update_osd | default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}" with_items: - noout - - norebalance - delegate_to: "{{ groups[mon_group_name][0] }}" + - nodeep-scrub - name: get osd versions command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"