Merge "B&R: Skip wiping OSDs at installation during restore"

This commit is contained in:
Zuul 2019-09-20 14:36:08 +00:00 committed by Gerrit Code Review
commit 8d4f64981d

View File

@ -66,16 +66,6 @@ fi
# Deactivate existing volume groups to avoid Anaconda issues with pre-existing groups
vgs --noheadings -o vg_name | xargs --no-run-if-empty -n 1 vgchange -an
# Check if active controller is available
curl -sf http://pxecontroller:6385/v1 2>&1 >/dev/null
if [ $? -eq 0 ]; then
echo "Active controller detected."
ACTIVE_EXISTS="true"
else
echo "No active controller detected, this is the initial install."
ACTIVE_EXISTS="false"
fi
ONLYUSE_HDD=""
if [ "$(curl -sf http://pxecontroller:6385/v1/upgrade/$(hostname)/in_upgrade 2>/dev/null)" = "true" ]; then
# In an upgrade, only wipe the disk with the rootfs and boot partition
@ -93,6 +83,15 @@ else
part_type_guid_str="Partition GUID code"
CEPH_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
# Check if we wipe OSDs
if [ "$(curl -sf http://pxecontroller:6385/v1/ihosts/wipe_osds 2>/dev/null)" = "true" ]; then
echo "Wipe OSD data."
WIPE_CEPH_OSDS="true"
else
echo "Skip Ceph OSD data wipe."
WIPE_CEPH_OSDS="false"
fi
for f in /dev/disk/by-path/*
do
dev=$(readlink -f $f)
@ -105,8 +104,8 @@ else
# Avoid wiping USB drives
udevadm info --query=property --name=$dev |grep -q '^ID_BUS=usb' && continue
# Avoid wiping ceph osds on initial install
if [ ${ACTIVE_EXISTS} == "false" ]; then
# Avoid wiping ceph osds if sysinv tells us so
if [ ${WIPE_CEPH_OSDS} == "false" ]; then
wipe_dev="true"
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
# Scanning the partitions looking for CEPH OSDs and