Add BlueStore OSDs support

Unlike bare-metal ceph, rook-ceph uses BlueStore OSDs,
where the disk has no partitions. So that the rook-ceph
OSDs are not wiped during a B&R, it is checked that the
disk's fs_type is 'ceph_bluestore'.

The 'blkid' command was used to identify the disk.

Test Plan:
- PASS: Build StarlingX image
- PASS: B&R with rook-ceph backend configured
- PASS: After reinstall controller-0, check if the OSD
        is present with the command "ceph-volume raw list"
- PASS: Remote subcloud install with Redfish

Story: 2011066
Task: 50890

Change-Id: Ibafdb8fc040da95bf3e18d7cb45dbc678734f9d1
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
This commit is contained in:
Erickson Silva de Oliveira 2024-08-19 22:07:28 -03:00
parent dab9c4774b
commit c451540c4b
2 changed files with 55 additions and 51 deletions

View File

@ -1458,33 +1458,26 @@ else
if [ ${WIPE_CEPH_OSDS} == "false" ] ; then
wipe_dev="true"
exec_no_fds "$STOR_DEV_FDS" "pvs" | grep -q "$dev *ceph"
if [ $? -eq 0 ] ; then
wlog "skip rook provisoned disk $dev"
continue
# Check if the disk is Rook Ceph OSD
fs_type=$(blkid -o value -s TYPE "${dev}")
if [ "${fs_type}" == "ceph_bluestore" ]; then
wlog "BlueStore OSD found on $dev, skipping wipe"
wipe_dev="false"
else
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
# Scanning the partitions looking for CEPH OSDs and
# skipping any disk found with such partitions
for part_number in "${part_numbers[@]}" ; do
sgdisk_part_info=$(sgdisk -i $part_number $dev)
part_type_guid=$(echo "$sgdisk_part_info" | grep "$part_type_guid_str" | awk '{print $4;}')
if [ "$part_type_guid" == $CEPH_OSD_GUID -o "$part_type_guid" == $CEPH_OSD_MPATH_GUID ]; then
wlog "OSD found on $dev, skipping wipe"
wipe_dev="false"
break
fi
done
fi
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
# Scanning the partitions looking for CEPH OSDs and
# skipping any disk found with such partitions
for part_number in "${part_numbers[@]}" ; do
sgdisk_part_info=$(sgdisk -i $part_number $dev)
part_type_guid=$(echo "$sgdisk_part_info" | grep "$part_type_guid_str" | awk '{print $4;}')
if [ "$part_type_guid" == $CEPH_OSD_GUID -o "$part_type_guid" == $CEPH_OSD_MPATH_GUID ]; then
wlog "OSD found on $dev, skipping wipe"
wipe_dev="false"
break
fi
dev_part_prefix=$(get_part_prefix "${dev}")
exec_no_fds "$STOR_DEV_FDS" "pvs" | grep -q -e "${dev_part_prefix}${part_number} *ceph" -e "${dev_part_prefix}p${part_number} *ceph"
if [ $? -eq 0 ]; then
wlog "Rook OSD found on $dev_part_prefix$part_number, skip wipe"
wipe_dev="false"
break
fi
done
if [ "$wipe_dev" == "false" ] ; then
continue
fi
@ -1513,6 +1506,15 @@ inst_dev=$(get_disk "${INSTDEV}")
for dev in ${WIPE_HDD//,/ } ; do
ilog "Wiping $dev"
# Check if the disk is Rook Ceph OSD
# see https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/ceph-teardown.md#zapping-devices
fs_type=$(blkid -o value -s TYPE "${dev}")
if [ "${fs_type}" == "ceph_bluestore" ]; then
sgdisk --zap-all "${dev}"
wipefs -a "${dev}"
continue
fi
# Clear previous GPT tables or LVM data on each disk.
#
# Rule: Exclude the persistent 'Platform backup' partition.

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2022-2023 Wind River Systems, Inc.
# Copyright (c) 2022-2024 Wind River Systems, Inc.
# SPDX-License-Identifier: Apache-2.0
#
############################################################################
@ -1361,33 +1361,26 @@ else
if [ ${WIPE_CEPH_OSDS} == "false" ]; then
wipe_dev="true"
exec_no_fds "$STOR_DEV_FDS" "pvs" | grep -q "$dev *ceph"
if [ $? -eq 0 ]; then
wlog "skip rook provisoned disk $dev"
continue
# Check if the disk is Rook Ceph OSD
fs_type=$(blkid -o value -s TYPE "${dev}")
if [ "${fs_type}" == "ceph_bluestore" ]; then
wlog "BlueStore OSD found on $dev, skipping wipe"
wipe_dev="false"
else
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
# Scanning the partitions looking for CEPH OSDs and
# skipping any disk found with such partitions
for part_number in "${part_numbers[@]}"; do
sgdisk_part_info=$(sgdisk -i $part_number $dev)
part_type_guid=$(echo "$sgdisk_part_info" | grep "$part_type_guid_str" | awk '{print $4;}')
if [ "$part_type_guid" == $CEPH_OSD_GUID -o "$part_type_guid" == $CEPH_OSD_MPATH_GUID ]; then
wlog "OSD found on $dev, skipping wipe"
wipe_dev="false"
break
fi
done
fi
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
# Scanning the partitions looking for CEPH OSDs and
# skipping any disk found with such partitions
for part_number in "${part_numbers[@]}"; do
sgdisk_part_info=$(sgdisk -i $part_number $dev)
part_type_guid=$(echo "$sgdisk_part_info" | grep "$part_type_guid_str" | awk '{print $4;}')
if [ "$part_type_guid" == $CEPH_OSD_GUID -o "$part_type_guid" == $CEPH_OSD_MPATH_GUID ]; then
wlog "OSD found on $dev, skipping wipe"
wipe_dev="false"
break
fi
dev_part_prefix=$(get_part_prefix "${dev}")
exec_no_fds "$STOR_DEV_FDS" "pvs" | grep -q -e "${dev_part_prefix}${part_number} *ceph" -e "${dev_part_prefix}p${part_number} *ceph"
if [ $? -eq 0 ]; then
wlog "Rook OSD found on $dev_part_prefix$part_number, skip wipe"
wipe_dev="false"
break
fi
done
if [ "$wipe_dev" == "false" ]; then
continue
fi
@ -1416,6 +1409,15 @@ inst_dev=$(get_disk "${INSTDEV}")
for dev in ${WIPE_HDD//,/ } ; do
ilog "Wiping $dev"
# Check if the disk is Rook Ceph OSD
# see https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/ceph-teardown.md#zapping-devices
fs_type=$(blkid -o value -s TYPE "${dev}")
if [ "${fs_type}" == "ceph_bluestore" ]; then
sgdisk --zap-all "${dev}"
wipefs -a "${dev}"
continue
fi
# Clear previous GPT tables or LVM data on each disk.
#
# Rule: Exclude the persistent 'Platform backup' partition.