Darryl L. Pierce
2009-Feb-17 21:44 UTC
[Ovirt-devel] [PATCH node] Checks if HostVG exists on any but the target device.
If such a volume groups exists on a different device, then an error
message is show to the user and the partitioning stops. Otherwise, it
continues as expected.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
scripts/ovirt-config-storage | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index faaf006..01ce3fc 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -85,6 +85,26 @@ check_partition_sizes()
printf "Required Space : $need_size MB\n\n"
fi
+ # check if an existing HostVG exists on a device other than the target
+ for vg in $(pvdisplay -c); do
+ eval $(echo $vg | awk '{match($0, "^([^:]*):([^:]*)", data);
print "device="data[1]" name="data[2]}')
+ if [ "$name" == "HostVG" -a "${device:0:8}" !=
"$DRIVE" ]; then
+ udi=$(hal-find-by-property --key block.device --string $device)
+ name=$(hal-get-property --udi $udi --key storage.serial)
+ printf "\n"
+ printf "There appears to already be an installation of oVirt on
another device:\n"
+ printf "\t$device ($name)\n"
+ printf "We cannot proceed until either this device is removed from
the system\n"
+ printf "or until the volume group is removed.\n"
+ printf "\nTo remove the volume group, please open a command shell
from the main\n"
+ printf "setup menu and do:\n"
+ printf "\nvgremove \"HostVG\"\n"
+ printf "\nand then try to perform partition again.\n"
+ printf "\n"
+ return 1
+ fi
+ done
+
return 0
}
--
1.6.0.6
Alan Pevec
2009-Feb-19 16:35 UTC
[Ovirt-devel] [PATCH node] Checks if HostVG exists on any but the target device.
On Tue, Feb 17, 2009 at 10:44 PM, Darryl L. Pierce <dpierce at redhat.com> wrote:> + # check if an existing HostVG exists on a device other than the target > + for vg in $(pvdisplay -c); do > + eval $(echo $vg | awk '{match($0, "^([^:]*):([^:]*)", data); print "device="data[1]" name="data[2]}')why not just: awk -F: '{print "device="$1" name="$2}' ACL with changed message pointing to new Uninstall option (yeah, should get that in first, for consistency :)