]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
vnewosd.sh: add script to add a new osd to an existing vstart
authorSage Weil <sage@redhat.com>
Mon, 10 Jun 2019 15:09:58 +0000 (10:09 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 13:37:49 +0000 (08:37 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/vnewosd.sh [new file with mode: 0755]

diff --git a/src/vnewosd.sh b/src/vnewosd.sh
new file mode 100755 (executable)
index 0000000..8d572cc
--- /dev/null
@@ -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