]> git.proxmox.com Git - ceph.git/blob - ceph/src/vnewosd.sh
import 15.2.1 Octopus source
[ceph.git] / ceph / src / vnewosd.sh
1 #!/bin/bash -ex
2
3 OSD_SECRET=`bin/ceph-authtool --gen-print-key`
4 echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > /tmp/$$
5 OSD_UUID=`uuidgen`
6 OSD_ID=`bin/ceph osd new $OSD_UUID -i /tmp/$$`
7 rm /tmp/$$
8 rm dev/osd$OSD_ID/* || true
9 mkdir -p dev/osd$OSD_ID
10 bin/ceph-osd -i $OSD_ID --mkfs --key $OSD_SECRET --osd-uuid $OSD_UUID
11 echo "[osd.$OSD_ID]
12 key = $OSD_SECRET" > dev/osd$OSD_ID/keyring
13 H=`hostname`
14 echo "[osd.$OSD_ID]
15 host = $H" >> ceph.conf