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

Do not force fail ceph-mgr after reconfiguring OSDs #770

Merged
Merged
Show file tree
Hide file tree
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
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
karelyatin marked this conversation as resolved.
Show resolved Hide resolved
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
Loading