diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/script/add_osd.sh | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | src/script/add_osd.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/script/add_osd.sh b/src/script/add_osd.sh new file mode 100755 index 000000000..a8dff6b3d --- /dev/null +++ b/src/script/add_osd.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -ex + +CEPH_DEV_DIR=dev +CEPH_BIN=bin +ceph_adm=$CEPH_BIN/ceph +osd=$1 +location=$2 +weight=.0990 + +# DANGEROUS +rm -rf $CEPH_DEV_DIR/osd$osd +mkdir -p $CEPH_DEV_DIR/osd$osd + +uuid=`uuidgen` +echo "add osd$osd $uuid" +OSD_SECRET=$($CEPH_BIN/ceph-authtool --gen-print-key) +echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > $CEPH_DEV_DIR/osd$osd/new.json +$CEPH_BIN/ceph osd new $uuid -i $CEPH_DEV_DIR/osd$osd/new.json +rm $CEPH_DEV_DIR/osd$osd/new.json +$CEPH_BIN/ceph-osd -i $osd $ARGS --mkfs --key $OSD_SECRET --osd-uuid $uuid + +key_fn=$CEPH_DEV_DIR/osd$osd/keyring +cat > $key_fn<<EOF +[osd.$osd] + key = $OSD_SECRET +EOF +echo adding osd$osd key to auth repository +$CEPH_BIN/ceph -i "$key_fn" auth add osd.$osd osd "allow *" mon "allow profile osd" mgr "allow profile osd" + +$CEPH_BIN/ceph osd crush add osd.$osd $weight $location + +echo start osd.$osd +$CEPH_BIN/ceph-osd -i $osd $ARGS $COSD_ARGS |