Skip to content

Commit

Permalink
Merge pull request #770 from fmount/ceph-mgr-issue
Browse files Browse the repository at this point in the history
Do not force fail ceph-mgr after reconfiguring OSDs
  • Loading branch information
openshift-merge-bot[bot] authored Jan 20, 2025
2 parents 07583db + bdd9646 commit 1f02da4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
38 changes: 38 additions & 0 deletions tests/roles/ceph_migrate/tasks/fail_mgr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Get a client using -v /home/tripleo-admin/ceph_config:/etc/ceph:z as input
- name: Refresh ceph_cli
ansible.builtin.include_tasks: ceph_cli.yaml
vars:
ceph_config_home: "{{ ceph_config_tmp_client_home }}"
ceph_fsid: "{{ mon_dump.fsid }}"
ceph_cluster: ceph

- name: Force fail ceph mgr
become: true
ansible.builtin.command: "{{ ceph_cli }} mgr fail"

- name: Wait for cephadm to reconcile
ansible.builtin.pause:
seconds: "{{ ceph_wait_mon_timeout }}"

- name: Get the ceph orchestrator status with
become: true
ansible.builtin.command: "{{ ceph_cli }} orch status --format json"
register: ceph_orch_status
async: 30
poll: 1
failed_when: false

- name: Restart ceph active mgr if ceph orch is not responding
become: true
when:
- ceph_orch_status.msg is defined
- '"Timeout exceeded" in ceph_orch_status.msg'
block:
- name: Restart the active mgr
ansible.builtin.command: "{{ ceph_cli }} mgr fail"
# This time we fail because something is wrong
- name: Fail if ceph orchestrator is still not responding
ansible.builtin.command: "{{ ceph_cli }} orch status --format json"
become: true
async: 30
poll: 1
6 changes: 2 additions & 4 deletions tests/roles/ceph_migrate/tasks/mon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@
msg: "Active mgr: {{ mgr.active_name }}"

- name: Fail mgr if active in the current node
become: true
ansible.builtin.command:
"{{ ceph_cli }} mgr fail {{ mgr.active_name }}"
ansible.builtin.include_tasks: fail_mgr.yaml
when:
- mgr.active_name | length > 0
- mgr.active_name | regex_search(cur_mon | split('.') | first) or mgr.active_name | regex_search(target_node | split('.') | first)
Expand Down Expand Up @@ -182,7 +180,7 @@
- name: reconfig osds
ansible.builtin.command: "{{ ceph_cli }} orch reconfig osd.default_drive_group "
- name: force-fail ceph mgr
ansible.builtin.command: "{{ ceph_cli }} mgr fail"
ansible.builtin.include_tasks: fail_mgr.yaml

- name: MON - Manage mons
# root privileges required to run cephadm
Expand Down

0 comments on commit 1f02da4

Please sign in to comment.