From f8478d4c56410e7e2397c95b32ce6c33b1addb86 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 12 Jul 2012 10:47:29 -0700 Subject: [PATCH] upstart: Make ceph-osd always set the crush location. 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 --- src/upstart/ceph-osd.conf | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/upstart/ceph-osd.conf b/src/upstart/ceph-osd.conf index ac902857e2262..cff5f431d3000 100644 --- a/src/upstart/ceph-osd.conf +++ b/src/upstart/ceph-osd.conf @@ -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 -- 2.39.5