Hi,
I've had issues when I put in new journal disks and wanted to move existing disks from one journal disk to the new ones.
The issues where, I set the osd into Out mode, then Stopped the OSD, and destroyed it.
Recreating the OSD with the new DB device make the OSD never to show up!
This is a known bug in Ceph luminous release: https://tracker.ceph.com/issues/22354
To solve this, I Outed the OSD, Stopped the OSD, Destroyed it in PVE to remove the journal 1gb partition and ran this script:
Hopes it helps someone in the interwebz
I've had issues when I put in new journal disks and wanted to move existing disks from one journal disk to the new ones.
The issues where, I set the osd into Out mode, then Stopped the OSD, and destroyed it.
Recreating the OSD with the new DB device make the OSD never to show up!
This is a known bug in Ceph luminous release: https://tracker.ceph.com/issues/22354
To solve this, I Outed the OSD, Stopped the OSD, Destroyed it in PVE to remove the journal 1gb partition and ran this script:
lsblk
read -p "Enter /dev/HDD<name> to be zapped: " devname
ceph osd tree
read -p "Enter osd.<nr> to be zapped: " osdnr
echo "*** Running ...\tsystemctl stop ceph-osd@$osdnr"
systemctl stop ceph-osd@$osdnr
echo "*** Running ...\tumount /var/lib/ceph/osd/ceph-$osdnr"
umount /var/lib/ceph/osd/ceph-$osdnr
echo "*** Running ...\tdd if=/dev/zero of=/dev/$devname bs=1M count=2048"
dd if=/dev/zero of=/dev/$devname bs=1M count=2048
echo "*** Running ...\tsgdisk -Z /dev/$devname\n"
sgdisk -Z /dev/$devname
echo "*** Running ...\tsgdisk -g /dev/$devname\n"
sgdisk -g /dev/$devname
echo "*** Running ...\tpartprobe"
partprobe /dev/$devname
echo "*** Running ...\tceph-disk zap /dev/$devname\n"
ceph-disk zap /dev/$devname
echo "*** Running ...\tceph osd out $osdnr\n"
ceph osd out $osdnr
echo "*** Running ...\tceph osd crush remove osd.$osdnr\n"
ceph osd crush remove osd.$osdnr
echo "*** Running ...\tceph auth del osd.$osdnr\n"
ceph auth del osd.$osdnr
echo "*** Running ...\tceph osd rm $osdnr\n"
ceph osd rm $osdnr
echo "*** Running ...\tpartprobe\n"
partprobe /dev/$devname
read -p "Enter /dev/HDD<name> to be zapped: " devname
ceph osd tree
read -p "Enter osd.<nr> to be zapped: " osdnr
echo "*** Running ...\tsystemctl stop ceph-osd@$osdnr"
systemctl stop ceph-osd@$osdnr
echo "*** Running ...\tumount /var/lib/ceph/osd/ceph-$osdnr"
umount /var/lib/ceph/osd/ceph-$osdnr
echo "*** Running ...\tdd if=/dev/zero of=/dev/$devname bs=1M count=2048"
dd if=/dev/zero of=/dev/$devname bs=1M count=2048
echo "*** Running ...\tsgdisk -Z /dev/$devname\n"
sgdisk -Z /dev/$devname
echo "*** Running ...\tsgdisk -g /dev/$devname\n"
sgdisk -g /dev/$devname
echo "*** Running ...\tpartprobe"
partprobe /dev/$devname
echo "*** Running ...\tceph-disk zap /dev/$devname\n"
ceph-disk zap /dev/$devname
echo "*** Running ...\tceph osd out $osdnr\n"
ceph osd out $osdnr
echo "*** Running ...\tceph osd crush remove osd.$osdnr\n"
ceph osd crush remove osd.$osdnr
echo "*** Running ...\tceph auth del osd.$osdnr\n"
ceph auth del osd.$osdnr
echo "*** Running ...\tceph osd rm $osdnr\n"
ceph osd rm $osdnr
echo "*** Running ...\tpartprobe\n"
partprobe /dev/$devname
Hopes it helps someone in the interwebz