if [ "$type" = "osd" ]; then
get_conf update_crush "" "osd crush update on start"
if [ "${update_crush:-1}" = "1" -o "{$update_crush:-1}" = "true" ]; then
- # update location in crush; put in some suitable defaults on the
- # command line, ceph.conf can override what it wants
- get_conf osd_location "" "osd crush location"
+ # update location in crush
+ get_conf osd_location_hook "$BINDIR/ceph-crush-location" "osd crush location hook"
+ osd_location=`$osd_location_hook --cluster ceph --id $id --type osd`
get_conf osd_weight "" "osd crush initial weight"
defaultweight="$(do_cmd "df $osd_data/. | tail -1 | awk '{ d= \$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }'")"
get_conf osd_keyring "$osd_data/keyring" "keyring"
-- \
$id \
${osd_weight:-${defaultweight:-1}} \
- root=default \
- host=$host \
$osd_location"
fi
fi
update="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_update_on_start || :)"
if [ "${update:-1}" = "1" -o "{$update:-1}" = "true" ]; then
- # update location in crush; put in some suitable defaults on the
- # command line, ceph.conf can override what it wants
- location="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location || :)"
+ # update location in crush
+ hook="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location_hook || :)"
+ location="$($hook --cluster ${cluster:-ceph} --id $id --type osd)"
weight="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_initial_weight || :)"
defaultweight=`df /var/lib/ceph/osd/${cluster:-ceph}-$id/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.2f", d); print r }'`
ceph \
-- \
"$id" \
"${weight:-${defaultweight:-1}}" \
- root=default \
- host="$(hostname -s)" \
$location
fi