[ceph-osd] Fix to check osd disk name instead of disk path

This is to fix the logic to use osd device name instaed of whole disk path
while osd initilizing.
also correct the ceph osd ls command to use correct keyring.

Change-Id: I90f0c3fd5d1e1b835326b1c690582990f7ca15cb
This commit is contained in:
Chinasubbareddy Mallavarapu 2020-01-29 19:38:34 -06:00
parent 792b016677
commit 63e43d98b7

View File

@ -83,7 +83,7 @@ function osd_disk_prepare {
fi
else
if [[ ! -z ${OSD_ID} ]]; then
if ceph osd ls |grep ${OSD_ID}; then
if ceph --name client.bootstrap-osd --keyring $OSD_BOOTSTRAP_KEYRING osd ls |grep ${OSD_ID}; then
echo "Running bluestore mode and ${OSD_DEVICE} already bootstrapped"
else
echo "found the wrong osd id which does not belong to current ceph cluster"
@ -93,7 +93,8 @@ function osd_disk_prepare {
DM_DEV=${OSD_DEVICE}$(sgdisk --print ${OSD_DEVICE} | grep "F800" | awk '{print $1}')
CEPH_DISK_USED=1
else
if dmsetup ls |grep -i ${OSD_DEVICE}; then
osd_dev_split=$(basename ${OSD_DEVICE})
if dmsetup ls |grep -i ${osd_dev_split}; then
CEPH_DISK_USED=1
fi
if [[ ${OSD_FORCE_REPAIR} -eq 1 ]] && [ ${CEPH_DISK_USED} -ne 1 ]; then