From 00b313de49261a9d46e452f1333b679972efcf3e Mon Sep 17 00:00:00 2001 From: Gustavo Ornaghi Antunes Date: Wed, 13 Sep 2023 12:04:04 -0300 Subject: [PATCH] Wipe all LVs during kickstart Backup and Restore are not completing because the manifest is not applied when trying drbd-cephmon turns primary, It is occurring because the LVs are not being wiped before being removed, so some garbage is impacting drbd-cephmon turns primary and causes the manifest fails to not be applied. To ensure that drbd-cephmon turns primary on first unlock, LVs will be wiped before recreating them during kickstart procedure. Test Plan: PASS: Backup and restore on AIO-DX PASS: Install AIO-SX over the previous installation without wiping the disks and checking the install.log to verify if the disks are wiped during kickstart. PASS: Install AIO-DX, reinstall Controller-1, and checking the install.log to verify if the disks were wiped during kickstart. Closes-Bug: #2031542 Change-Id: Ib00d77fbc9dfd62e9c94f418e29f2805f8a0c036 Signed-off-by: Gustavo Ornaghi Antunes --- kickstart/files/kickstart.cfg | 9 +++++++++ kickstart/files/miniboot.cfg | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 1669505c..68f11851 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -1297,6 +1297,15 @@ if [ ${#vgs[@]} -eq 0 ] ; then ilog "No volume groups found" else for vg in ${vgs[@]} ; do + lvs=( $(exec_no_fds "$STOR_DEV_FDS" "lvs --select vg_uuid=${vg} --noheadings -o lv_name 2>/dev/null") ) + vg_name=$(exec_no_fds "$STOR_DEV_FDS" "vgdisplay -C --noheadings --select vg_uuid=${vg} -o vg_name 2>/dev/null" | xargs) + + ilog "Wipe any previous signatures from ${vg_name} volume group" + for lv in ${lvs[@]} ; do + ilog "Wipe any previous signatures from ${lv} logical volume" + exec_no_fds "$STOR_DEV_FDS" "wipefs -a /dev/${vg_name}/${lv} 2>/dev/null" 5 0.5 || wlog "Failed to wipe signatures from ${lv}" + done + ilog "Disable volume group ${vg}" exec_no_fds "$STOR_DEV_FDS" "vgchange -an --select vg_uuid=${vg} 2>/dev/null" 5 0.5 [ $? -ne 0 ] && report_failure_with_msg "Failed to disable ${vg}." diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index 970e46ea..d7c65f6f 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -1228,6 +1228,15 @@ if [ ${#vgs[@]} -eq 0 ] ; then ilog "No volume groups found" else for vg in ${vgs[@]}; do + lvs=( $(exec_no_fds "$STOR_DEV_FDS" "lvs --select vg_uuid=${vg} --noheadings -o lv_name 2>/dev/null") ) + vg_name=$(exec_no_fds "$STOR_DEV_FDS" "vgdisplay -C --noheadings --select vg_uuid=${vg} -o vg_name 2>/dev/null" | xargs) + + ilog "Wipe any previous signatures from ${vg_name} volume group" + for lv in ${lvs[@]} ; do + ilog "Wipe any previous signatures from ${lv} logical volume" + exec_no_fds "$STOR_DEV_FDS" "wipefs -a /dev/${vg_name}/${lv} 2>/dev/null" 5 0.5 || wlog "Failed to wipe signatures from ${lv}" + done + ilog "Disable volume group ${vg}" exec_no_fds "$STOR_DEV_FDS" "vgchange -an --select vg_uuid=${vg} 2>/dev/null" 5 0.5 [ $? -ne 0 ] && report_failure_with_msg "Failed to disable ${vg}."