From: Dan van der Ster Date: Fri, 22 Apr 2016 14:37:25 +0000 (+0200) Subject: compute correct defaultweight for bluestore X-Git-Tag: v11.0.0~876^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6f36b5424f7229d78a34dfd21a7c624728de6886;p=ceph.git compute correct defaultweight for bluestore The default crush weight should be the size of the block device, not the tiny 10M xfs partition. Backport: jewel Signed-off-by: Dan van der Ster --- diff --git a/src/ceph-osd-prestart.sh b/src/ceph-osd-prestart.sh index cefca854e61f..c9a777d9661c 100644 --- a/src/ceph-osd-prestart.sh +++ b/src/ceph-osd-prestart.sh @@ -30,7 +30,11 @@ if [ "${update:-1}" = "1" -o "${update:-1}" = "true" ]; then fi 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 -P -k $data/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.4f", d); print r }'` + if [ -e $data/block ]; then + defaultweight=`blockdev --getsize64 $data/block | awk '{ d= $1/1099511627776 ; r = sprintf("%.4f", d); print r }'` + else + defaultweight=`df -P -k $data/ | tail -1 | awk '{ d= $2/1073741824 ; r = sprintf("%.4f", d); print r }'` + fi ceph \ --cluster="${cluster:-ceph}" \ --name="osd.$id" \