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>
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