Skip to content

Commit

Permalink
upstart: Use "ceph osd crush create-or-move".
Browse files Browse the repository at this point in the history
Now the weight is only set when adding the OSD to the CRUSH map for
the first time. Once it's there, it's only moved, and the weight is
left untouched.

Change the ceph.conf option for the initial weight from
osd_crush_weight to osd_crush_initial_weight, to reflect this.

If you don't want new OSDs to store data automatically (to minimize
balancing and keep a human in the control loop), you can now
set osd_crush_initial_weight=0.

Closes: ceph#3101
Signed-off-by: Tommi Virtanen <[email protected]>
  • Loading branch information
Tommi Virtanen committed Sep 11, 2012
1 parent 331bbcf commit fb6c5c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/upstart/ceph-osd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ pre-start script
# 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 || :)"
weight="$(ceph-conf --cluster="$cluster" --name="osd.$id" --lookup osd_crush_weight || :)"
weight="$(ceph-conf --cluster="$cluster" --name="osd.$id" --lookup osd_crush_initial_weight || :)"
ceph \
--cluster="${cluster:-ceph}" \
--name="osd.$id" \
--keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
osd crush set \
osd crush create-or-move \
-- \
"$id" "osd.$id" "${weight:-1}" \
"$id" \
"${weight:-1}" \
root=default \
host="$(hostname -s)" \
$location \
Expand Down

0 comments on commit fb6c5c3

Please sign in to comment.