From eb851a9da05bc0ca6fb1ff7d62563999036dcc10 Mon Sep 17 00:00:00 2001 From: Don Penney Date: Tue, 26 Nov 2019 11:52:49 -0500 Subject: [PATCH] Update kickstarts to remove cgts-vg as needed In some scenarious, such as when the cgts-vg volume group spans multiple disks, the disk wiping in the kickstarts is insufficient to clear existing LVM metadata, and anaconda reports a failure to create the cgts-vg volume group as a result. This update adds explicit cleanup of the logical and physical volumes associated with cgts-vg, if not already wiped by the user prior to installation, and removes cgts-vg itself. This is done ahead of the anaconda partitioning, avoiding any conflict with automatic creation of the new cgts-vg. Change-Id: Id33cab02e1cecbfee8035cc55213c99ef3cea34d Closes-Bug: 1854082 Signed-off-by: Don Penney --- bsp-files/kickstarts/pre_disk_setup_common.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bsp-files/kickstarts/pre_disk_setup_common.cfg b/bsp-files/kickstarts/pre_disk_setup_common.cfg index 6a456f22..1b3965c2 100644 --- a/bsp-files/kickstarts/pre_disk_setup_common.cfg +++ b/bsp-files/kickstarts/pre_disk_setup_common.cfg @@ -66,6 +66,11 @@ 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 +# Remove volumes and group for cgts-vg, if any +lvremove --force cgts-vg +pvs --select 'vg_name=cgts-vg' --noheadings -o pv_name | xargs --no-run-if-empty pvremove --force --force --yes +vgs --select 'vg_name=cgts-vg' --noheadings -o vg_name | xargs --no-run-if-empty vgremove --force + 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