diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 5b33aafb..0d5cbcaf 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -161,6 +161,11 @@ function report_failure_with_msg() ######################################################################### function get_disk() { + if echo \$1 | grep -q mpath; then + find -L /dev/mapper/ -samefile \$1 + return + fi + echo "\$(cd /dev ; readlink -f \$1)" } @@ -172,6 +177,14 @@ function get_disk() ######################################################################### function get_by_path() { + local dev_name=\$(basename \$1) + for p in /dev/mapper/mpath*; do + if [ "\$p" = "\$1" -o "\$p" = "/dev/mapper/\$dev_name" ]; then + find -L /dev/disk/by-id/dm-uuid* -samefile /dev/mapper/\$dev_name + return + fi + done + # log "Function: get_by_path '\${1}'" local disk=\$(cd /dev ; readlink -f \$1) for p in /dev/disk/by-path/*; do @@ -195,6 +208,7 @@ function get_disk_dev() if [ -d /sys/block/\$blk_dev ]; then disk=\$(ls -l /sys/block/\$blk_dev | grep -v usb | head -n1 | sed 's/^.*\([vsdh]d[a-z]\+\).*\$/\1/'); if [ -n "\$disk" ]; then + exec_retry 3 0.5 "multipath -c /dev/\$disk" > /dev/null && continue echo "\$disk" return fi @@ -209,6 +223,12 @@ function get_disk_dev() fi fi done + for mpath_dev in mpatha mpathb; do + if [ -e /dev/mapper/\$mpath_dev ]; then + echo "/dev/mapper/\$mpath_dev" + return + fi + done } ######################################################################### @@ -810,6 +830,7 @@ check_execs # TODO: The installer does not have 'timezone' # Does LAT handle this ? wlog "timezone not set ; 'timezone --nontp --utc UTC'" +breakpoint true %end @@ -876,11 +897,23 @@ for f in /dev/disk/by-path/*; do dev=$(readlink -f $f) # dlog "found device ${f}" exec_retry 2 0.5 "lsblk --nodeps --pairs $dev" | grep -q 'TYPE="disk"' - if [ $? -eq 0 ] ; then - # Filter out ISO disk from storage devices - check_valid_dev $dev || continue - STOR_DEVS="$STOR_DEVS $dev" - ilog "Adding ${f} -> ${dev} to managed device list" + if [ $? -eq 0 ]; then + exec_retry 3 0.5 "multipath -c $dev" > /dev/null + if [ $? -eq 0 ]; then + mpath_dev=/dev/mapper/$(exec_retry 3 0.5 "multipath -l $dev" | head -n1 | cut -d " " -f 1) + if echo $STOR_DEVS | grep -q -w $mpath_dev; then + continue + else + STOR_DEVS="$STOR_DEVS $mpath_dev" + mpath_path=$(find -L /dev/disk/by-id/dm-uuid* -samefile $mpath_dev) + ilog "Adding ${mpath_path}->${mpath_dev} to managed device list" + fi + else + # Filter out ISO disk from storage devices + check_valid_dev $dev || continue + STOR_DEVS="$STOR_DEVS $dev" + ilog "Adding ${f} -> ${dev} to managed device list" + fi fi done @@ -994,8 +1027,10 @@ else WIPE_HDD="" # Partition type OSD has a unique globally identifier - CEPH_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D" - CEPH_JOURNAL_GUID="45B0969E-9B03-4F30-B4C6-B4B80CEFF106" + CEPH_REGULAR_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D" + CEPH_REGULAR_JOURNAL_GUID="45B0969E-9B03-4F30-B4C6-B4B80CEFF106" + CEPH_MPATH_OSD_GUID="4FBD7E29-8AE0-4982-BF9D-5A8D867AF560" + CEPH_MPATH_JOURNAL_GUID="45B0969E-8AE0-4982-BF9D-5A8D867AF560" # Check if we wipe OSDs if [ "$(curl -sf http://pxecontroller:6385/v1/ihosts/wipe_osds 2>/dev/null)" = "true" ]; then @@ -1047,7 +1082,7 @@ else 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 ]; then + if [ "$part_type_guid" == $CEPH_REGULAR_OSD_GUID -o "$part_type_guid" == $CEPH_MPATH_OSD_GUID ]; then wlog "OSD found on $dev, skipping wipe" wipe_dev="false" break @@ -1187,7 +1222,7 @@ do fi fi - if [ $WIPE_CEPH_OSDS == "true" -a "$part_type_guid" == $CEPH_JOURNAL_GUID ]; then + if [[ $WIPE_CEPH_OSDS == "true" && ( "$part_type_guid" == $CEPH_REGULAR_JOURNAL_GUID || "$part_type_guid" == $CEPH_MPATH_JOURNAL_GUID ) ]]; then # Journal partitions require additional wiping. Based on the ceph-manage-journal.py # script in the integ repo (at the ceph/ceph/files/ceph-manage-journal.py location) # wiping 100MB of data at the beginning of the partition should be enough. We also diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index be812ec9..1d9a2745 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -994,8 +994,10 @@ else WIPE_HDD="" # Partition type OSD has a unique globally identifier - CEPH_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D" - CEPH_JOURNAL_GUID="45B0969E-9B03-4F30-B4C6-B4B80CEFF106" + CEPH_REGULAR_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D" + CEPH_REGULAR_JOURNAL_GUID="45B0969E-9B03-4F30-B4C6-B4B80CEFF106" + CEPH_MPATH_OSD_GUID="4FBD7E29-8AE0-4982-BF9D-5A8D867AF560" + CEPH_MPATH_JOURNAL_GUID="45B0969E-8AE0-4982-BF9D-5A8D867AF560" # Check if we wipe OSDs if [ "$(curl -sf http://pxecontroller:6385/v1/ihosts/wipe_osds 2>/dev/null)" = "true" ]; then @@ -1047,7 +1049,7 @@ else 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 ]; then + if [ "$part_type_guid" == $CEPH_REGULAR_OSD_GUID -o "$part_type_guid" == $CEPH_MPATH_OSD_GUID ]; then wlog "OSD found on $dev, skipping wipe" wipe_dev="false" break @@ -1187,7 +1189,7 @@ do fi fi - if [ $WIPE_CEPH_OSDS == "true" -a "$part_type_guid" == $CEPH_JOURNAL_GUID ]; then + if [[ $WIPE_CEPH_OSDS == "true" && ( "$part_type_guid" == $CEPH_REGULAR_JOURNAL_GUID || "$part_type_guid" == $CEPH_MPATH_JOURNAL_GUID ) ]]; then # Journal partitions require additional wiping. Based on the ceph-manage-journal.py # script in the integ repo (at the ceph/ceph/files/ceph-manage-journal.py location) # wiping 100MB of data at the beginning of the partition should be enough. We also