[ceph] remove old parts

This commit is contained in:
Nico Schottelius 2020-10-01 23:52:39 +02:00
parent f30413d834
commit 02cb81de72

View file

@ -29,7 +29,6 @@ fi
export DEV=$1;shift export DEV=$1;shift
export CLASS=$1; shift export CLASS=$1; shift
uuid_metadata=$(uuidgen) uuid_metadata=$(uuidgen)
uuid_block=$(uuidgen) uuid_block=$(uuidgen)
@ -65,14 +64,10 @@ mkdir -p "$mountpath"
mount "$dev_metadata" "$mountpath" mount "$dev_metadata" "$mountpath"
ln -s $dev_block "$mountpath/block" ln -s $dev_block "$mountpath/block"
echo "$uuid_block" > "$mountpath/block_uuid" echo "$uuid_block" > "$mountpath/block_uuid"
echo "$fsid" > "$mountpath/ceph_fsid" echo "$fsid" > "$mountpath/ceph_fsid"
echo "$magic" > "$mountpath/magic" echo "$magic" > "$mountpath/magic"
# Not needed (anymore) - using ceph osd crush set-device-class below
#echo "$CLASS" > "$mountpath/crush_device_class"
# Important, otherwise --mkfs later will try to create filestore # Important, otherwise --mkfs later will try to create filestore
echo bluestore > "$mountpath/type" echo bluestore > "$mountpath/type"
@ -85,8 +80,8 @@ touch "$mountpath/sysvinit"
ceph-osd --cluster ceph -i "${osd_id}" --mkfs ceph-osd --cluster ceph -i "${osd_id}" --mkfs
chown -R ceph:ceph "$mountpath" chown -R ceph:ceph "$mountpath"
# Also allow access to the blockdevices - via symlink # Also allow access to the blockdevice
chown ceph:ceph "${mountpath}/block" chown ceph:ceph ${dev_block}
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
WEIGHT=$1; shift WEIGHT=$1; shift
@ -96,9 +91,10 @@ else
WEIGHT=$(lsblk -l -b | awk "/^$nodev/ { print \$4/(1024^4) }") WEIGHT=$(lsblk -l -b | awk "/^$nodev/ { print \$4/(1024^4) }")
fi fi
# Move into the correct position
ceph osd crush add osd.${osd_id} ${WEIGHT} host=$(hostname) ceph osd crush add osd.${osd_id} ${WEIGHT} host=$(hostname)
# Ensure previous assigned class is gone # Ensure previous assigned class is gone - if the osd id was used before
ceph osd crush rm-device-class osd.${osd_id} ceph osd crush rm-device-class osd.${osd_id}
ceph osd crush set-device-class $CLASS osd.${osd_id} ceph osd crush set-device-class $CLASS osd.${osd_id}
@ -110,5 +106,3 @@ if [ -e /etc/monit ]; then
else else
/etc/init.d/ceph start osd.${osd_id} /etc/init.d/ceph start osd.${osd_id}
fi fi
#rm "$mountpath/crush_device_class"