From e2a60422df079cc633efc730a6f2ddea4cdc10f6 Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Thu, 2 Jan 2020 17:15:40 -0600 Subject: [PATCH] [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 --- .../bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl b/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl index 57f0238e3b..14b4245a2b 100644 --- a/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl +++ b/ceph-osd/templates/bin/osd/ceph-volume/_init-with-ceph-volume.sh.tpl @@ -349,6 +349,11 @@ function osd_disk_prepare { BLOCK_DB=${VG}/ceph-db-${osd_dev_string} flock -u "${lock_fd}" 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 if pvdisplay ${OSD_DEVICE} | grep "VG Name" | awk '{print $3}' | grep "ceph"; then CEPH_LVM_PREPARE=0