Merge "Ceph OSD Init Improvements"

This commit is contained in:
Zuul 2021-06-25 21:56:26 +00:00 committed by Gerrit Code Review
commit d067a0bb7a
4 changed files with 13 additions and 12 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph OSD description: OpenStack-Helm Ceph OSD
name: ceph-osd name: ceph-osd
version: 0.1.23 version: 0.1.24
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -36,7 +36,7 @@ function check_osd_metadata {
local tmpmnt=$(mktemp -d) local tmpmnt=$(mktemp -d)
mount ${DM_DEV} ${tmpmnt} mount ${DM_DEV} ${tmpmnt}
if [ "x$JOURNAL_TYPE" != "xdirectory" ]; then if [ "x${JOURNAL_TYPE}" != "xdirectory" ]; then
if [ -f "${tmpmnt}/whoami" ]; then if [ -f "${tmpmnt}/whoami" ]; then
OSD_JOURNAL_DISK=$(readlink -f "${tmpmnt}/journal") OSD_JOURNAL_DISK=$(readlink -f "${tmpmnt}/journal")
local osd_id=$(cat "${tmpmnt}/whoami") local osd_id=$(cat "${tmpmnt}/whoami")
@ -113,7 +113,7 @@ function determine_what_needs_zapping {
fi fi
if [ ${OSD_FORCE_REPAIR} -eq 1 ] && [ ! -z ${DM_DEV} ]; then if [ ${OSD_FORCE_REPAIR} -eq 1 ] && [ ! -z ${DM_DEV} ]; then
if [ -b $DM_DEV ]; then if [ -b ${DM_DEV} ]; then
local ceph_fsid=$(ceph-conf --lookup fsid) local ceph_fsid=$(ceph-conf --lookup fsid)
if [ ! -z "${ceph_fsid}" ]; then if [ ! -z "${ceph_fsid}" ]; then
# Check the OSD metadata and zap the disk if necessary # Check the OSD metadata and zap the disk if necessary
@ -165,7 +165,7 @@ function osd_journal_prepare {
else else
OSD_JOURNAL=${OSD_JOURNAL} OSD_JOURNAL=${OSD_JOURNAL}
fi fi
elif [ "x$JOURNAL_TYPE" != "xdirectory" ]; then elif [ "x${JOURNAL_TYPE}" != "xdirectory" ]; then
# The block device exists but doesn't appear to be paritioned, we will proceed with parititioning the device. # The block device exists but doesn't appear to be paritioned, we will proceed with parititioning the device.
OSD_JOURNAL=$(readlink -f ${OSD_JOURNAL}) OSD_JOURNAL=$(readlink -f ${OSD_JOURNAL})
until [ -b ${OSD_JOURNAL} ]; do until [ -b ${OSD_JOURNAL} ]; do
@ -173,7 +173,7 @@ function osd_journal_prepare {
done done
fi fi
chown ceph. ${OSD_JOURNAL}; chown ceph. ${OSD_JOURNAL};
elif [ "x$JOURNAL_TYPE" != "xdirectory" ]; then elif [ "x${JOURNAL_TYPE}" != "xdirectory" ]; then
echo "No journal device specified. OSD and journal will share ${OSD_DEVICE}" echo "No journal device specified. OSD and journal will share ${OSD_DEVICE}"
echo "For better performance on HDD, consider moving your journal to a separate device" echo "For better performance on HDD, consider moving your journal to a separate device"
fi fi

View File

@ -181,16 +181,16 @@ function osd_disk_prechecks {
fi fi
if [[ ! -b "${OSD_DEVICE}" ]]; then if [[ ! -b "${OSD_DEVICE}" ]]; then
echo "ERROR- The device pointed by OSD_DEVICE ($OSD_DEVICE) doesn't exist !" echo "ERROR- The device pointed by OSD_DEVICE (${OSD_DEVICE}) doesn't exist !"
exit 1 exit 1
fi fi
if [ ! -e $OSD_BOOTSTRAP_KEYRING ]; then if [ ! -e ${OSD_BOOTSTRAP_KEYRING} ]; then
echo "ERROR- $OSD_BOOTSTRAP_KEYRING must exist. You can extract it from your current monitor by running 'ceph auth get client.bootstrap-osd -o $OSD_BOOTSTRAP_KEYRING'" echo "ERROR- ${OSD_BOOTSTRAP_KEYRING} must exist. You can extract it from your current monitor by running 'ceph auth get client.bootstrap-osd -o ${OSD_BOOTSTRAP_KEYRING}'"
exit 1 exit 1
fi fi
timeout 10 ceph ${CLI_OPTS} --name client.bootstrap-osd --keyring $OSD_BOOTSTRAP_KEYRING health || exit 1 timeout 10 ceph --name client.bootstrap-osd --keyring ${OSD_BOOTSTRAP_KEYRING} health || exit 1
} }
function perform_zap { function perform_zap {
@ -212,6 +212,9 @@ function perform_zap {
if [[ "${STORAGE_TYPE}" != "directory" ]]; then if [[ "${STORAGE_TYPE}" != "directory" ]]; then
# Check to make sure we have what we need to continue
osd_disk_prechecks
# Settle LVM changes before inspecting volumes # Settle LVM changes before inspecting volumes
udev_settle udev_settle
@ -242,9 +245,6 @@ if [[ "${STORAGE_TYPE}" != "directory" ]]; then
# Settle LVM changes again after any changes have been made # Settle LVM changes again after any changes have been made
udev_settle udev_settle
# Check to make sure we have what we need to continue
osd_disk_prechecks
# Initialize some important global variables # Initialize some important global variables
CEPH_LVM_PREPARE=1 CEPH_LVM_PREPARE=1
OSD_ID=$(get_osd_id_from_device ${OSD_DEVICE}) OSD_ID=$(get_osd_id_from_device ${OSD_DEVICE})

View File

@ -24,4 +24,5 @@ ceph-osd:
- 0.1.21 Refactor Ceph OSD Init Scripts - First PS - 0.1.21 Refactor Ceph OSD Init Scripts - First PS
- 0.1.22 Refactor Ceph OSD Init Scripts - Second PS - 0.1.22 Refactor Ceph OSD Init Scripts - Second PS
- 0.1.23 Use full image ref for docker official images - 0.1.23 Use full image ref for docker official images
- 0.1.24 Ceph OSD Init Improvements
... ...