From fb6c5c3e9a3537fc495f9bf5c81f78ed69c4891b Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Tue, 11 Sep 2012 10:07:04 -0700 Subject: [PATCH] upstart: Use "ceph osd crush create-or-move". 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: #3101 Signed-off-by: Tommi Virtanen --- src/upstart/ceph-osd.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index b6498acbbd6cc..e471a6c26a9dc 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -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 \ -- 2.39.5