init-ceph: if we fail to set an OSD's crush position, continue

If we fail to set the CRUSH position for one OSD, continue on to try
starting others, just as we do when we fail to start the daemon.

Fixes: #8342
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2014-05-20 16:29:23 -07:00
parent 46f1eb6865
commit d04b386bdf

View File

@ -327,7 +327,11 @@ for name in $what; do
get_conf osd_weight "" "osd crush initial weight"
defaultweight="$(df -P -k $osd_data/. | tail -1 | awk '{ print sprintf("%.2f",$2/1073741824) }')"
get_conf osd_keyring "$osd_data/keyring" "keyring"
do_cmd "timeout 30 $BINDIR/ceph -c $conf --name=osd.$id --keyring=$osd_keyring osd crush create-or-move -- $id ${osd_weight:-${defaultweight:-1}} $osd_location"
do_cmd_okfail "timeout 30 $BINDIR/ceph -c $conf --name=osd.$id --keyring=$osd_keyring osd crush create-or-move -- $id ${osd_weight:-${defaultweight:-1}} $osd_location"
if [ "$ERR" != "0" ]; then
EXIT_STATUS=$ERR
continue
fi
fi
fi