summaryrefslogtreecommitdiffstats
path: root/src/vnewosd.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/vnewosd.sh
parentInitial commit. (diff)
downloadceph-upstream/16.2.11+ds.tar.xz
ceph-upstream/16.2.11+ds.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-xsrc/vnewosd.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vnewosd.sh b/src/vnewosd.sh
new file mode 100755
index 000000000..8d572ccab
--- /dev/null
+++ b/src/vnewosd.sh
@@ -0,0 +1,15 @@
+#!/bin/bash -ex
+
+OSD_SECRET=`bin/ceph-authtool --gen-print-key`
+echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > /tmp/$$
+OSD_UUID=`uuidgen`
+OSD_ID=`bin/ceph osd new $OSD_UUID -i /tmp/$$`
+rm /tmp/$$
+rm dev/osd$OSD_ID/* || true
+mkdir -p dev/osd$OSD_ID
+bin/ceph-osd -i $OSD_ID --mkfs --key $OSD_SECRET --osd-uuid $OSD_UUID
+echo "[osd.$OSD_ID]
+key = $OSD_SECRET" > dev/osd$OSD_ID/keyring
+H=`hostname`
+echo "[osd.$OSD_ID]
+host = $H" >> ceph.conf