[Ovirt-devel] [PATCH node 1/6] Fix for detecting HP CCISS devices.
Michael Burns
mburns at redhat.com
Sat Sep 26 02:33:52 UTC 2009
Since HAL doesn't properly identify them, this patch goes to /dev/cciss/ and
collects the name of all devices found there.
support cciss disks in storage_init parameter
cciss disks are separate bus in udev
NB: fix is needed for RHEL5 udev rules (rhev-h includes it):
https://bugzilla.redhat.com/show_bug.cgi?id=513070#c24
example:
/dev/disk/by-id/cciss-3600508b100104a3953545233304c0003
/dev/disk/by-id/cciss-3600508b100104a3953545233304c0003-part1
/dev/disk/by-id/cciss-3600508b100104a3953545233304c0003-part2
udevinfo -n /dev/disk/by-id/cciss-3600508b100104a3953545233304c0003
-q env
ID_SERIAL=3600508b100104a3953545233304c0003
ID_BUS=cciss
handle cciss and multipath partition in uninstall
Signed-off-by: Michael Burns <mburns at redhat.com>
---
scripts/ovirt-config-storage | 7 +++++++
scripts/ovirt-config-uninstall | 11 ++++++++++-
scripts/ovirt-early | 13 +++++++++----
3 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index eed126c..473826f 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -169,6 +169,13 @@ get_dev_name()
devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)"
devices=$(echo $devices | tr ' ' '\n' | sort -u | xargs)
+ # FIXME: workaround for dealing with cciss devices
+ for dev in $(ls /dev/cciss/ 2>/dev/null); do
+ if [[ ! $dev =~ p[0-9]+\$ ]]; then
+ devices="$devices /dev/cciss/$dev"
+ fi
+ done
+
local num_devices=$(echo "$devices" | wc -w)
# If there's only one device, use it.
case $num_devices in
diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall
index 02828a0..fd65cbb 100755
--- a/scripts/ovirt-config-uninstall
+++ b/scripts/ovirt-config-uninstall
@@ -31,10 +31,18 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?"
if [ -d /dev/HostVG ]; then
log "Uninstalling node"
log "Detaching logging"
+ # multipathd holds all mounts under /var in a private namespace
+ service multipathd stop
unmount_logging
log "Removing volume group"
wipe_volume_group "HostVG"
- partition=$(findfs LABEL=BOOT)
+ rc=$?
+ if [ $rc -ne 0 ]; then
+ log "Aborting"
+ service multipathd start
+ exit $rc
+ fi
+ partition=$(readlink -f $(findfs LABEL=BOOT))
if [ -n "$partition" ]; then
log "Unmounting boot partition"
umount $partition
@@ -43,6 +51,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?"
parted -s $drive "rm 1"
parted -s $drive "rm 2"
fi
+ service multipathd restart
printf "Finished uninstalling node."
else
log "There is no installed node instance to remove."
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index cdd4afd..8990727 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -109,7 +109,7 @@ find_disk() {
local bus=$1
local serial=$2
local live=$(get_live_disk)
- for d in /dev/disk/by-id/{scsi,usb}*; do
+ for d in /dev/disk/by-id/{scsi,usb,cciss}*; do
ID_FS_USAGE=
eval $(udev_info $d env)
# ID_FS_USAGE is set for partitions
@@ -132,7 +132,7 @@ find_disk() {
start() {
# oVirt boot parameters
# BOOTIF=link|eth*|<MAC> (appended by pxelinux)
- # ovirt_init=[usb|scsi[:serial#]|/dev/...]
+ # ovirt_init=[usb|scsi|ccis[:serial#]|/dev/...]
# ovirt_vol=BOOT_MB:SWAP_MB:ROOT_MB:CONFIG_MB:LOGGING_MB:DATA_MB
# ovirt_overcommit=<overcommit_ratio>
# ovirt_local_boot
@@ -159,7 +159,7 @@ start() {
# BOOTIF=eth* e.g. BOOTIF=eth0 - use given interface
bootif=
- # ovirt_init=[usb|scsi[:serial#]|/dev/...]
+ # ovirt_init=[usb|scsi|cciss[:serial#]|/dev/...]
# local installation target disk
# usb|scsi - select disk type, as reported by udev ID_BUS
# serial# - select exact disk using serial number, as reported by
@@ -278,6 +278,11 @@ start() {
i=${i#=usb}
serial=${i#:}
;;
+ =cciss*)
+ bus=cciss
+ i=${i#cciss}
+ serial=${i#:}
+ ;;
=/dev/*)
bus=
serial=
@@ -295,7 +300,7 @@ start() {
fi
else
# 'ovirt_init' without value: grab first disk
- init=$(ls -1 /dev/?da 2>/dev/null |head -n1)
+ init=$(ls -1 /dev/?da /dev/cciss/c?d? 2>/dev/null |head -n1)
fi
if [ -z "$init" ]; then
log "Selected disk $i is not valid."
--
1.6.2.5
More information about the ovirt-devel
mailing list