[ceph-osd] fix the issue with ceph-osd init

This is to fix the issue with ceph-osd initilization when deployed
with wal and db on same disk as pod restart always trying to prepare
the disk.

this ps will make sure to handle the case and skip the ceph-volume prepare
step in case of already deployed osd disk.

Change-Id: I5c37568f342cb4362a0de0a9c11a52b7aea3e147
This commit is contained in:
Chinasubbareddy Mallavarapu 2020-01-02 17:15:40 -06:00 committed by chinasubbareddy mallavarapu
parent 954a06b3fd
commit e2a60422df

View File

@ -349,6 +349,11 @@ function osd_disk_prepare {
BLOCK_DB=${VG}/ceph-db-${osd_dev_string} BLOCK_DB=${VG}/ceph-db-${osd_dev_string}
flock -u "${lock_fd}" flock -u "${lock_fd}"
fi fi
if [ -z ${BLOCK_DB} ] && [ -z ${BLOCK_WAL} ]; then
if pvdisplay ${OSD_DEVICE} | grep "VG Name" | awk '{print $3}' | grep "ceph"; then
CEPH_LVM_PREPARE=0
fi
fi
else else
if pvdisplay ${OSD_DEVICE} | grep "VG Name" | awk '{print $3}' | grep "ceph"; then if pvdisplay ${OSD_DEVICE} | grep "VG Name" | awk '{print $3}' | grep "ceph"; then
CEPH_LVM_PREPARE=0 CEPH_LVM_PREPARE=0