Skip to content

Commit

Permalink
day2: set noout at the bucket level instead
Browse files Browse the repository at this point in the history
It is safer to set the `noout` flag at the bucket level instead of the
whole cluster.
This commit updates the 3 playbooks where we set `noout` flag so it
doesn't set it at the whole cluster level anymore.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
  • Loading branch information
guits committed Dec 16, 2020
1 parent 942ab27 commit 4699443
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 35 deletions.
30 changes: 18 additions & 12 deletions infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,17 @@
state: absent
when: not containerized_deployment | bool

- name: set osd flags
- name: set osd flag nodeep-scrub
hosts: "{{ mon_group_name|default('mons') }}[0]"
become: true
gather_facts: false
tasks:
- import_role:
name: ceph-defaults

- name: set osd flags
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set {{ item }}"
- name: set osd flag nodeep-scrub
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set nodeep-scrub"
changed_when: false
with_items:
- noout
- nodeep-scrub
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

Expand All @@ -441,6 +438,12 @@
tasks_from: container_binary.yml
when: containerized_deployment | bool

- name: set osd flag noout
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set-group noout {{ inventory_hostname }}"
changed_when: false
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

- name: get osd list
ceph_volume:
cluster: "{{ cluster }}"
Expand Down Expand Up @@ -509,20 +512,23 @@
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

- name: unset osd flags
- name: unset osd flag noout
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset-group noout {{ inventory_hostname }}"
changed_when: false
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

- name: unset osd flag nodeep-scrub
hosts: "{{ mon_group_name|default('mons') }}[0]"
become: true
gather_facts: false
tasks:
- import_role:
name: ceph-defaults

- name: unset osd flags
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset {{ item }}"
- name: unset osd flag nodeep-scrub
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset nodeep-scrub"
changed_when: false
with_items:
- noout
- nodeep-scrub
environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

Expand Down
39 changes: 28 additions & 11 deletions infrastructure-playbooks/rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
name: ceph-mgr


- name: set osd flags
- name: set osd flag nodeep-scrub
hosts: "{{ mon_group_name | default('mons') }}[0]"
become: True
tasks:
Expand All @@ -345,16 +345,13 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: set osd flags
- name: set osd flag nodeep-scrub
ceph_osd_flag:
name: "{{ item }}"
name: "nodeep-scrub"
cluster: "{{ cluster }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
with_items:
- noout
- nodeep-scrub

- name: upgrade ceph osds cluster
vars:
Expand All @@ -371,6 +368,17 @@
- import_role:
name: ceph-facts

- name: set osd flag noout
ceph_osd_flag:
name: noout
level: bucket
bucket: "{{ inventory_hostname }}"
cluster: "{{ cluster }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- name: get osd numbers - non container
shell: if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi # noqa 306
register: osd_ids
Expand Down Expand Up @@ -440,6 +448,18 @@
delay: "{{ health_osd_check_delay }}"
when: (ceph_pgs.stdout | from_json).pg_summary.num_pgs != 0

- name: unset osd flag noout
ceph_osd_flag:
name: noout
state: absent
level: bucket
bucket: "{{ inventory_hostname }}"
cluster: "{{ cluster }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"


- name: complete osd upgrade
hosts: "{{ mon_group_name|default('mons') }}[0]"
Expand All @@ -451,17 +471,14 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: unset osd flags
- name: unset osd flag nodeep-scrub
ceph_osd_flag:
name: "{{ item }}"
name: "nodeep-scrub"
cluster: "{{ cluster }}"
state: absent
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
with_items:
- noout
- nodeep-scrub

- name: upgrade ceph mdss cluster, deactivate all rank > 0
hosts: "{{ mon_group_name | default('mons') }}[0]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
name: ceph-mgr


- name: set osd flags
- name: set osd flag nodeep-scrub
hosts: "{{ mon_group_name | default('mons') }}[0]"
become: True
tasks:
Expand All @@ -211,16 +211,13 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: set osd flags
- name: set osd flag nodeep-scrub
ceph_osd_flag:
name: "{{ item }}"
name: "nodeep-scrub"
cluster: "{{ cluster }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
with_items:
- noout
- nodeep-scrub


- name: switching from non-containerized to containerized ceph osd
Expand All @@ -239,6 +236,17 @@
- import_role:
name: ceph-defaults

- name: set osd flag noout
ceph_osd_flag:
name: noout
level: bucket
bucket: "{{ inventory_hostname }}"
cluster: "{{ cluster }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- name: collect running osds
shell: |
set -o pipefail;
Expand Down Expand Up @@ -351,8 +359,19 @@
delay: "{{ health_osd_check_delay }}"
changed_when: false

- name: unset osd flag noout
ceph_osd_flag:
name: noout
state: absent
level: bucket
bucket: "{{ inventory_hostname }}"
cluster: "{{ cluster }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"

- name: unset osd flags
- name: unset osd flag nodeep-scrub
hosts: "{{ mon_group_name | default('mons') }}[0]"
become: True
tasks:
Expand All @@ -362,17 +381,14 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: set osd flags
- name: set osd flag nodeep-scrub
ceph_osd_flag:
name: "{{ item }}"
name: "nodeep-scrub"
cluster: "{{ cluster }}"
state: absent
environment:
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
with_items:
- noout
- nodeep-scrub

- name: switching from non-containerized to containerized ceph mds

Expand Down

0 comments on commit 4699443

Please sign in to comment.