From: Guilhem Lettron Date: Thu, 7 Mar 2013 14:32:13 +0000 (+0100) Subject: Set weight of an osd based on df. X-Git-Tag: v0.60~107^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d43384df51f0685e533e4ccc347f09c8bb9b5852;p=ceph.git Set weight of an osd based on df. priority to Weight in ceph.conf Signed-off-by: Guilhem Lettron --- diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index ff05fdfc0066..7bf8d704e265 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -21,6 +21,7 @@ pre-start script # command line, ceph.conf can override what it wants location="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_location || :)" 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 \ --cluster="${cluster:-ceph}" \ --name="osd.$id" \ @@ -28,7 +29,7 @@ pre-start script osd crush create-or-move \ -- \ "$id" \ - "${weight:-1}" \ + "${weight:-${defaultweight:-1}}" \ root=default \ host="$(hostname -s)" \ $location \