Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip ci] update: convert straw bucket #6689

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions infrastructure-playbooks/rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,43 @@
- import_role:
name: ceph-dashboard

- name: switch any existing crush buckets to straw2
hosts: "{{ mon_group_name | default('mons') }}[0]"
become: true
any_errors_fatal: true
gather_facts: false
tasks:
- import_role:
name: ceph-defaults

- import_role:
name: ceph-facts
tasks_from: container_binary.yml

- name: set_fact ceph_cmd
set_fact:
ceph_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }}"

- name: backup the crushmap
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd getcrushmap -o /etc/ceph/{{ cluster }}-crushmap"
changed_when: false

- block:
- name: switch crush buckets to straw2
command: "{{ ceph_cmd }} --cluster {{ cluster }} crush set-all-straw-buckets-to-straw2"
changed_when: false
rescue:
- name: restore the crushmap
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd setcrushmap -i /etc/ceph/{{ cluster }}-crushmap"
changed_when: false

- name: switching to straw2 buckets failed
debug:
msg: >
"An attempt to switch to straw2 bucket was made but failed.
Check the cluster status."


- name: show ceph status
hosts: "{{ mon_group_name|default('mons') }}"
become: True
Expand Down