From: Sage Weil Date: Wed, 13 Feb 2013 21:58:49 +0000 (-0800) Subject: upstart/ceph-osd: make crush update on start optional X-Git-Tag: v0.58~51^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1af749eb992131a50fe83f0ad4a6e8363d8e4cc6;p=ceph.git upstart/ceph-osd: make crush update on start optional By default, we will do some (minimal) CRUSH tree adjustment. However, we make this update optional. Fixes: #3993 Signed-off-by: Sage Weil --- diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index 23ca2eb2a23..ff05fdfc006 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -15,28 +15,31 @@ pre-start script install -d -m0755 /var/run/ceph - # 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_initial_weight || :)" - ceph \ - --cluster="${cluster:-ceph}" \ - --name="osd.$id" \ - --keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \ - osd crush create-or-move \ - -- \ - "$id" \ - "${weight:-1}" \ - root=default \ - host="$(hostname -s)" \ - $location \ - || : + update="$(ceph-conf --cluster=${cluster:-ceph} --name=osd.$id --lookup osd_crush_update_on_start || :)" + if [ "${update:-1}" = "1" -o "{$update:-1}" = "true" ]; then + # 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:-ceph} --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 create-or-move \ + -- \ + "$id" \ + "${weight:-1}" \ + root=default \ + host="$(hostname -s)" \ + $location \ + || : + fi journal="/var/lib/ceph/osd/${cluster:-ceph}-$id/journal" if [ -L "$journal" -a ! -e "$journal" ]; then - echo "ceph-osd($UPSTART_INSTANCE): journal not present, not starting yet." 1>&2 - stop - exit 0 + echo "ceph-osd($UPSTART_INSTANCE): journal not present, not starting yet." 1>&2 + stop + exit 0 fi end script