Skip to content

Commit 9b4c47a

Browse files
committed
day2: set noout at the bucket level instead
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 <[email protected]>
1 parent 942ab27 commit 9b4c47a

File tree

3 files changed

+78
-35
lines changed

3 files changed

+78
-35
lines changed

Diff for: infrastructure-playbooks/cephadm-adopt.yml

+18-12
Original file line numberDiff line numberDiff line change
@@ -410,20 +410,17 @@
410410
state: absent
411411
when: not containerized_deployment | bool
412412

413-
- name: set osd flags
413+
- name: set osd flag nodeep-scrub
414414
hosts: "{{ mon_group_name|default('mons') }}[0]"
415415
become: true
416416
gather_facts: false
417417
tasks:
418418
- import_role:
419419
name: ceph-defaults
420420

421-
- name: set osd flags
422-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set {{ item }}"
421+
- name: set osd flag nodeep-scrub
422+
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set nodeep-scrub"
423423
changed_when: false
424-
with_items:
425-
- noout
426-
- nodeep-scrub
427424
environment:
428425
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
429426

@@ -441,6 +438,12 @@
441438
tasks_from: container_binary.yml
442439
when: containerized_deployment | bool
443440

441+
- name: set osd flag noout
442+
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd set-group noout {{ inventory_hostname }}"
443+
changed_when: false
444+
environment:
445+
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
446+
444447
- name: get osd list
445448
ceph_volume:
446449
cluster: "{{ cluster }}"
@@ -509,20 +512,23 @@
509512
environment:
510513
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
511514

512-
- name: unset osd flags
515+
- name: unset osd flag noout
516+
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset-group noout {{ inventory_hostname }}"
517+
changed_when: false
518+
environment:
519+
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
520+
521+
- name: unset osd flag nodeep-scrub
513522
hosts: "{{ mon_group_name|default('mons') }}[0]"
514523
become: true
515524
gather_facts: false
516525
tasks:
517526
- import_role:
518527
name: ceph-defaults
519528

520-
- name: unset osd flags
521-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset {{ item }}"
529+
- name: unset osd flag nodeep-scrub
530+
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} osd unset nodeep-scrub"
522531
changed_when: false
523-
with_items:
524-
- noout
525-
- nodeep-scrub
526532
environment:
527533
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
528534

Diff for: infrastructure-playbooks/rolling_update.yml

+28-11
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
name: ceph-mgr
336336

337337

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

348-
- name: set osd flags
348+
- name: set osd flag nodeep-scrub
349349
ceph_osd_flag:
350-
name: "{{ item }}"
350+
name: "nodeep-scrub"
351351
cluster: "{{ cluster }}"
352352
environment:
353353
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
354354
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
355-
with_items:
356-
- noout
357-
- nodeep-scrub
358355

359356
- name: upgrade ceph osds cluster
360357
vars:
@@ -371,6 +368,17 @@
371368
- import_role:
372369
name: ceph-facts
373370

371+
- name: set osd flag noout
372+
ceph_osd_flag:
373+
name: noout
374+
level: bucket
375+
bucket: "{{ inventory_hostname }}"
376+
cluster: "{{ cluster }}"
377+
delegate_to: "{{ groups[mon_group_name][0] }}"
378+
environment:
379+
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
380+
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
381+
374382
- name: get osd numbers - non container
375383
shell: if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi # noqa 306
376384
register: osd_ids
@@ -440,6 +448,18 @@
440448
delay: "{{ health_osd_check_delay }}"
441449
when: (ceph_pgs.stdout | from_json).pg_summary.num_pgs != 0
442450

451+
- name: unset osd flag noout
452+
ceph_osd_flag:
453+
name: noout
454+
state: absent
455+
level: bucket
456+
bucket: "{{ inventory_hostname }}"
457+
cluster: "{{ cluster }}"
458+
delegate_to: "{{ groups[mon_group_name][0] }}"
459+
environment:
460+
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
461+
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
462+
443463

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

454-
- name: unset osd flags
474+
- name: unset osd flag nodeep-scrub
455475
ceph_osd_flag:
456-
name: "{{ item }}"
476+
name: "nodeep-scrub"
457477
cluster: "{{ cluster }}"
458478
state: absent
459479
environment:
460480
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
461481
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
462-
with_items:
463-
- noout
464-
- nodeep-scrub
465482

466483
- name: upgrade ceph mdss cluster, deactivate all rank > 0
467484
hosts: "{{ mon_group_name | default('mons') }}[0]"

Diff for: infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml

+32-12
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
name: ceph-mgr
202202

203203

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

214-
- name: set osd flags
214+
- name: set osd flag nodeep-scrub
215215
ceph_osd_flag:
216-
name: "{{ item }}"
216+
name: "nodeep-scrub"
217217
cluster: "{{ cluster }}"
218218
environment:
219219
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
220220
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
221-
with_items:
222-
- noout
223-
- nodeep-scrub
224221

225222

226223
- name: switching from non-containerized to containerized ceph osd
@@ -239,6 +236,21 @@
239236
- import_role:
240237
name: ceph-defaults
241238

239+
- import_role:
240+
name: ceph-facts
241+
tasks_from: container_binary.yml
242+
243+
- name: set osd flag noout
244+
ceph_osd_flag:
245+
name: noout
246+
level: bucket
247+
bucket: "{{ inventory_hostname }}"
248+
cluster: "{{ cluster }}"
249+
delegate_to: "{{ groups[mon_group_name][0] }}"
250+
environment:
251+
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
252+
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
253+
242254
- name: collect running osds
243255
shell: |
244256
set -o pipefail;
@@ -351,8 +363,19 @@
351363
delay: "{{ health_osd_check_delay }}"
352364
changed_when: false
353365

366+
- name: unset osd flag noout
367+
ceph_osd_flag:
368+
name: noout
369+
state: absent
370+
level: bucket
371+
bucket: "{{ inventory_hostname }}"
372+
cluster: "{{ cluster }}"
373+
delegate_to: "{{ groups[mon_group_name][0] }}"
374+
environment:
375+
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
376+
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
354377

355-
- name: unset osd flags
378+
- name: unset osd flag nodeep-scrub
356379
hosts: "{{ mon_group_name | default('mons') }}[0]"
357380
become: True
358381
tasks:
@@ -362,17 +385,14 @@
362385
name: ceph-facts
363386
tasks_from: container_binary.yml
364387

365-
- name: set osd flags
388+
- name: set osd flag nodeep-scrub
366389
ceph_osd_flag:
367-
name: "{{ item }}"
390+
name: "nodeep-scrub"
368391
cluster: "{{ cluster }}"
369392
state: absent
370393
environment:
371394
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
372395
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
373-
with_items:
374-
- noout
375-
- nodeep-scrub
376396

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

0 commit comments

Comments
 (0)