Skip to content

Commit

Permalink
Merge pull request ceph#91 from Youscribe/defaultweight
Browse files Browse the repository at this point in the history
Set weight of an osd based on df.

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Mar 11, 2013
2 parents 494f968 + d43384d commit 25f8d2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/upstart/ceph-osd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ 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" \
--keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
osd crush create-or-move \
-- \
"$id" \
"${weight:-1}" \
"${weight:-${defaultweight:-1}}" \
root=default \
host="$(hostname -s)" \
$location \
Expand Down

0 comments on commit 25f8d2c

Please sign in to comment.