Skip to content

Commit

Permalink
ensure at least one osd is up
Browse files Browse the repository at this point in the history
The existing task checks that the number of OSDs is equal to the number of up OSDs before continuing.

The problem is that if none of the OSDs have been discovered yet, the task will exit immediately and subsequent pool creation will fail (num_osds = 0, num_up_osds = 0).

This is related to Bugzilla 1578086.

In this change, we also check that at least one OSD is present. In our testing, this results in the task correctly waiting for all OSDs to come up before continuing.
  • Loading branch information
dwaiting committed Dec 10, 2018
1 parent 114fac1 commit ed2abf7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions roles/ceph-osd/tasks/openstack_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: wait for all osd to be up
shell: >
test "$({{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["osdmap"]["osdmap"]["num_osds"])')" -gt 0 &&
test "$({{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["osdmap"]["osdmap"]["num_osds"])')" =
"$({{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["osdmap"]["osdmap"]["num_up_osds"])')"
register: wait_for_all_osds_up
Expand Down

0 comments on commit ed2abf7

Please sign in to comment.