Merge "B&R: Skip wiping OSDs at installation during restore"
This commit is contained in:
commit
8d4f64981d
@ -66,16 +66,6 @@ fi
|
|||||||
# Deactivate existing volume groups to avoid Anaconda issues with pre-existing groups
|
# 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
|
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=""
|
ONLYUSE_HDD=""
|
||||||
if [ "$(curl -sf http://pxecontroller:6385/v1/upgrade/$(hostname)/in_upgrade 2>/dev/null)" = "true" ]; then
|
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
|
# 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"
|
part_type_guid_str="Partition GUID code"
|
||||||
CEPH_OSD_GUID="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
|
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/*
|
for f in /dev/disk/by-path/*
|
||||||
do
|
do
|
||||||
dev=$(readlink -f $f)
|
dev=$(readlink -f $f)
|
||||||
@ -105,8 +104,8 @@ else
|
|||||||
# Avoid wiping USB drives
|
# Avoid wiping USB drives
|
||||||
udevadm info --query=property --name=$dev |grep -q '^ID_BUS=usb' && continue
|
udevadm info --query=property --name=$dev |grep -q '^ID_BUS=usb' && continue
|
||||||
|
|
||||||
# Avoid wiping ceph osds on initial install
|
# Avoid wiping ceph osds if sysinv tells us so
|
||||||
if [ ${ACTIVE_EXISTS} == "false" ]; then
|
if [ ${WIPE_CEPH_OSDS} == "false" ]; then
|
||||||
wipe_dev="true"
|
wipe_dev="true"
|
||||||
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
|
part_numbers=( `parted -s $dev print | awk '$1 == "Number" {i=1; next}; i {print $1}'` )
|
||||||
# Scanning the partitions looking for CEPH OSDs and
|
# Scanning the partitions looking for CEPH OSDs and
|
||||||
|
Loading…
Reference in New Issue
Block a user