Trying to "ceph tell" a newly created OSD sometime triggers an
ENXIO. The OSD creation function used for test scripts waits for the OSD
to report that it is up (according to ceph osd tree) before
returning. That reduces (maybe close ?) the condition that triggers the
error so that the tests do not randomly fail.
http://tracker.ceph.com/issues/8630 refs: #8630
Signed-off-by: Loic Dachary <loic@dachary.org>
[ "$id" = "$(cat $osd_data/whoami)" ] || return 1
./ceph osd crush create-or-move "$id" 1 root=default host=localhost
+
+ status=1
+ # Workaround for http://tracker.ceph.com/issues/8630
+ for ((i=0; i < 60; i++)); do
+ if ! ceph osd dump | grep "osd.$id up"; then
+ sleep 1
+ else
+ status=0
+ break
+ fi
+ done
+
+ return $status
}