2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-15 10:50:28 +00:00

fix xdsh p8euh configraid delete_raid=all hangs when delete raid 0

This commit is contained in:
bybai
2015-10-21 02:47:21 -04:00
parent 97ce3ff5c7
commit ed6427da31
2 changed files with 29 additions and 4 deletions

View File

@ -51,7 +51,7 @@ function usagesc {
echo ' pci_slot_name is the specified PCI location. If specify pci_slot_name, this raid will be created using disks from this pci_slot;'
echo ' disk_names is a list of advanced format disk names. If specify disk_names, this raid will be created using these disks;'
echo ' Example 1, create 2 raid0 arrays, one is using 3 disks, the other is using 2 disks, the disks PCI_ID is 1014:034a:'
echo ' create_raid="rl#0|pci_id#1014:034a|disk_num#1 create_raid="rl#0|pci_id#1014:034a|disk_num#2'
echo ' create_raid="rl#0|pci_id#1014:034a|disk_num#1" create_raid="rl#0|pci_id#1014:034a|disk_num#2"'
echo ' Example 2, pci_slot_name is 0001:08:00.0, create raid10 array, using 2 disks '
echo ' create_raid="rl#10|pci_slot_name#0001:08:00.0|disk_num#2"'
echo ' Example 3, create 1 raid0 array using advanced format disk sg1'

View File

@ -1319,12 +1319,12 @@ function sort_devices_by_resource_path {
return 0
}
#########################################################################################
##########################################################################################################################
#
# wait to check ipr device status
# usage: wait_for_ipr_device_status "tryCnt=<minitutes> tryInt=<seconds> cmd=<command_string>"
# usage: wait_for_ipr_device_status tryCnt=<minitutes> tryInt=<interval_seconds> cmd="check_cmd_line" -- "sg0,sg1,...,sgn"
#
#########################################################################################
#########################################################################################################################
function wait_for_ipr_device_status {
local tryCnt=1
local tryInt=10
@ -1392,6 +1392,31 @@ function wait_for_ipr_device_status {
return $rc
}
##############################################################
#
# check status of ipr devices
# input : slocs list, for example, 0:0:0:0 0:0:1:0
# usage : check_ipr_device_status <sloc1> <sloc2> ... <slocn>
#
##############################################################
function check_ipr_device_status {
local sgs="$*"
local lines=`convert_sloc_to_sg $sgs`
local item
for item in $sgs
do
declare sg=`echo "$lines" | $awk -F= -vkey=$item '$1 == key {print $2;}'`
declare _sg_status=`$iprconfig -c status $sg`
if [ "$_sg_status" = "Rebuilding" ]; then
declare _sg_status_alt=`cmd_alt_status $sg`
[ -n "$_sg_status_alt" ] && _sg_status="$_sg_status, $_sg_status_alt"
fi
echo "$item=$_sg_status"
done
return 0
}
######################################################
#