diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index ff05fdfc0066f..7bf8d704e2658 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 \