In cases when wipedisk isn't run or isn't working correctly,
pre-existing volume groups, physical volumes, and logical volumes will
be present on the root disk. Depending on the sizes and layout of the
previous install along with partial or aborted cleanup activities, this
may lead [unknown] PVs with duplicate volume group names.
Adjust the cleanup logic to:
- Discover existing volume groups by UUID so that duplicate volume
groups (i.e two occurrences of cgts-vg) can be handled individually.
- Ignore [unknown] physical volumes in a volume group as they cannnot be
removed. Cleaning up existing physical volumes across all volume
groups will resolve any [unknown] physical volumes.
In addition, unify if/then for/do syntax in the %pre-part hook
Test Plan:
PASS - create a scenario with multiple partitions along with a
nova-local and cgts-vg volume group that result in an [unknown]
physical volume and a duplicate cgts-vg. Do not wipe the disks
and install an ISO with the above changes. Observe proper cleanup
and install.
PASS - Perform consecutive installs without wipedisk and observe proper
cleanup and install
Change-Id: Idf845cf00ca3c009d72dedef0805a77d94fa3d97
Partial-Bug: #1998204
Signed-off-by: Robert Church <robert.church@windriver.com>