]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
upstart: Make ceph-osd always set the crush location.
authorTommi Virtanen <tv@inktank.com>
Thu, 12 Jul 2012 17:47:29 +0000 (10:47 -0700)
committerTommi Virtanen <tv@inktank.com>
Wed, 5 Sep 2012 18:28:04 +0000 (11:28 -0700)
This used to be conditional on config having osd_crush_location set,
but with that, minimal configuration left the OSD completely out of
the crush map, and prevented the OSD from starting properly.

Note: Ceph does not currently let this mechanism automatically move
hosts to another location in the CRUSH hierarchy. This means if you
let this run with defaults, setting osd_crush_location later will not
take effect. Set up your config file (or Chef environment) fully
before starting the OSDs the first time.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
src/upstart/ceph-osd.conf

index ac902857e2262061efee1f070a1e2a85ffe9b3d7..cff5f431d3000b4804b91f65108d13bd9e4dcf67 100644 (file)
@@ -15,9 +15,8 @@ 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 || :)"
-    if [ -n "$location" ]; then
-      weight="$(ceph-conf --cluster="$cluster" --name="osd.$id" --lookup osd_crush_weight || :)"
-      ceph \
+    weight="$(ceph-conf --cluster="$cluster" --name="osd.$id" --lookup osd_crush_weight || :)"
+    ceph \
         --cluster="${cluster:-ceph}" \
         --name="osd.$id" \
         --keyring="/var/lib/ceph/osd/${cluster:-ceph}-$id/keyring" \
@@ -28,8 +27,6 @@ pre-start script
        host="$(hostname -s)" \
        $location \
        || :
-    fi
-
 end script
 
 instance ${cluster:-ceph}/$id