]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: fix osd bootstrap
authorSage Weil <sage@redhat.com>
Thu, 1 Feb 2018 15:26:31 +0000 (09:26 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:50 +0000 (14:44 -0600)
Install the key before trying to use it for mkfs.  Among other things
this means the osd can fetch it's config from the mon before doing the
mkfs step.

Signed-off-by: Sage Weil <sage@redhat.com>
src/vstart.sh

index 14a843061ef04d17ad37006f5d9305fbdd1e2c2b..cfd137df80f94a4d31a81cb928d6363efd1d5a7a 100755 (executable)
@@ -610,9 +610,10 @@ EOF
 
             local uuid=`uuidgen`
             echo "add osd$osd $uuid"
-            ceph_adm osd create $uuid
-            ceph_adm osd crush add osd.$osd 1.0 host=$HOSTNAME root=default
            OSD_SECRET=$($CEPH_BIN/ceph-authtool --gen-print-key)
+           echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > dev/osd$osd/new.json
+            ceph_adm osd new $uuid -i dev/osd$osd/new.json
+           rm dev/osd$osd/new.json
             $SUDO $CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --key $OSD_SECRET --osd-uuid $uuid
 
             local key_fn=$CEPH_DEV_DIR/osd$osd/keyring