Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core

prep softlayer related files for backporting to 2.8
This commit is contained in:
Bruce Potter 2014-06-02 09:54:58 -04:00
commit 5b0a30a986
4 changed files with 177 additions and 81 deletions

View File

@ -51,6 +51,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`
if [ ! -z "$BMCPORT" ]; then
let idev=0
IFS=','
for p in $BMCPORT; do
ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null
ipmitool -d $idev raw 0x04 0x12 0x09 0x01 0x18 0x${p}1 0x00 > /dev/null
@ -61,6 +62,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM
done
let idev=idev+1
done
unset IFS
fi
elif [ "$XPROD" == "291" ]; then
LOCKEDUSERS=1
@ -70,6 +72,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`
if [ ! -z "$BMCPORT" ]; then
let idev=0
IFS=','
for p in $BMCPORT; do
ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null
CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'`
@ -79,6 +82,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM
done
let idev=idev+1
done
unset IFS
fi
fi
fi
@ -92,6 +96,7 @@ elif [ "$IPMIMFG" == 20301 ] ; then
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`
if [ ! -z "$BMCPORT" ]; then
let idev=0
IFS=','
for p in $BMCPORT; do
ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null
# after this change, we need to watch and wait to see that it
@ -108,6 +113,7 @@ elif [ "$IPMIMFG" == 20301 ] ; then
let idev=idev+1
done
unset IFS
fi
elif [ "$IPMIMFG" == "47488" ]; then
LOCKEDUSERS=1

View File

@ -1541,6 +1541,7 @@ sub power_with_context {
return;
} elsif ($subcommand eq "wake") {
$sessdata->{ipmisession}->subcmd(netfn=>0x3a,command=>0x1d,data=>[0,0],callback=>\&power_response,callback_args=>$sessdata);
return;
} elsif (not $argmap{$subcommand}) {
xCAT::SvrUtils::sendmsg([1,"unsupported command power $subcommand"],$callback);
return;
@ -1956,11 +1957,20 @@ sub got_bios_buildid {
my $sessdata = $res{sessdata};
if ($res{data}) {
$sessdata->{biosbuildid} = $res{data};
get_imm_property(property=>"/v2/bios/build_version",callback=>\&got_bios_version,sessdata=>$sessdata);
get_imm_property(property=>"/v2/bios/pending_build_version",callback=>\&got_bios_pending_buildid,sessdata=>$sessdata);
} else {
initfru_with_mprom($sessdata);
}
}
sub got_bios_pending_buildid {
my %res = @_;
my $sessdata = $res{sessdata};
$sessdata->{biosbuildpending} = 0;
if ($res{data} and $res{data} ne ' ') {
$sessdata->{biosbuildpending} = 1;
}
get_imm_property(property=>"/v2/bios/build_version",callback=>\&got_bios_version,sessdata=>$sessdata);
}
sub got_bios_version {
my %res = @_;
my $sessdata = $res{sessdata};
@ -1979,7 +1989,12 @@ sub got_bios_date {
my $fru = FRU->new();
$fru->rec_type("bios,uefi,firmware");
$fru->desc("UEFI Version");
$fru->value($sessdata->{biosbuildversion}." (".$sessdata->{biosbuildid}." ".$sessdata->{biosbuilddate}.")");
my $pending = "";
if ($sessdata->{biosbuildpending}) {
$pending = " [PENDING]";
}
my $value = $sessdata->{biosbuildversion}." (".$sessdata->{biosbuildid}." ".$sessdata->{biosbuilddate}.")$pending";
$fru->value($value);
$sessdata->{fru_hash}->{uefi} = $fru;
get_imm_property(property=>"/v2/fpga/build_id",callback=>\&got_fpga_buildid,sessdata=>$sessdata);
} else {

View File

@ -13,7 +13,8 @@ if [ -z "$PRINIC" ]
then
for karg in $(cat /proc/cmdline |sed -e 's/-/:/g' -e 's/ /\n/g'); do
if [ "${karg%%=*}" = "BOOTIF" ]; then
export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
#export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
export PRINIC=`ip -o link|grep -i "${karg#*=}"|awk '{print $2}'|sed s/://`
fi
done
if [ -z "$PRINIC" ]; then
@ -24,13 +25,16 @@ if [ -z "$PRINIC" ]
then
export PRINIC=eth0
elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then
export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
#export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://`
fi
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
#IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}')
if [ -z $IP ]
then
dhclient eth0
IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
#IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}')
IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}')
fi
export HOSTNAME=$(host $IP 2>/dev/null | awk '{print $5}' | awk -F. '{print $1}')

View File

@ -20,6 +20,7 @@
#
NR=$1
THINGY=$2
offer_help() {
@ -31,10 +32,18 @@ offer_help() {
cat <<EOF
$PROGNAME (part of the BEF_Scripts for xCAT) v$VERSION
Usage: $PROGNAME NODERANGE | xcoll
Usage: $PROGNAME NODERANGE [FILTER] | xcoll
--help Display this help output.
NODERANGE
An xCAT noderange on which to operate.
FILTER
A string to match in the output, filtering out everything else. This
is passed to "egrep" and can be a simple string or a regular
expression.
EOF
cat <<'EOF'
@ -52,52 +61,68 @@ Purpose:
Example output:
In the output below, note the following discrepancies for the node
storage1 (as compared with all of the other nodes): "rate",
"PortRcvErrors", and "IB HCA FW Active". Looks like that guy may
need a restart of the OFED stack to engage his newly installed
firmware. ;-)
#
# This example shows that all of rack 14 has the same settings.
#
root@mgt1:~ # test_hca_state rack14 | xcoll
====================================
rack14
====================================
OFED Version: MLNX_OFED_LINUX-2.0-3.0.0.3 (OFED-2.0-3.0.0):
mlx4_0
PCI: Gen3
Firmware installed: 2.30.3200
Firmware active: 2.30.3200
log_num_mtt: 20
log_mtts_per_seg: 3
Port 1: InfiniBand phys_state: 5: LinkUp
state: 4: ACTIVE
rate: 40 Gb/sec (4X FDR10)
symbol_error: 0
port_rcv_errors: 0
Port 2: InfiniBand phys_state: 3: Disabled
state: 1: DOWN
rate: 10 Gb/sec (4X)
symbol_error: 0
port_rcv_errors: 0
IPoIB
recv_queue_size: 8192
send_queue_size: 8192
ib0:
Mode: datagram
MTU: 4092
Mode: up
ib1:
Mode: datagram
MTU: 4092
Mode: up
[root]# test_hca_state compute,storage | xcoll
#
# This example uses a FILTER on the word 'firmware'. In this case, we've
# upgraded the firmware across rack11 and rack12.
#
# - On rack11, we've also restarted the IB stack (/etc/init.d/openibd
# restart) to activate the new firmware.
#
# - Rack 12 has also been updated, as we can see from the 'Firmware
# installed' line, but it's nodes are still running with their prior
# level of firmware and must reload the IB stack to have it take effect.
#
root@mgt1:~ # test_hca_state rack11,rack12 firmware | xcoll
====================================
storage1
rack11
====================================
OFED: MLNX_OFED_LINUX-1.5.3-4.0.22.3 (OFED-1.5.3-4.0.22):
mlx4_0/1:
phys state: 5: LinkUp
rate: 40 Gb/sec (4X FDR10)
PCI: Gen3
SymbolErrorCounter: 0
PortRcvErrors: 31
IB HCA FW Installed: 2.11.500
IB HCA FW Active: 2.10.2372
mlx4_core set_4k_mtu: 0
mlx4_core log_num_mtt: 20
mlx4_core log_mtts_per_seg: 7
IPoIB Mode: connected
IPoIB MTU: 65520
IPoIB recv_queue_size: 8192
IPoIB send_queue_size: 8192
Firmware installed: 2.30.3200
Firmware active: 2.30.3200
====================================
compute,storage2,storage3,storage4
rack12
====================================
OFED: MLNX_OFED_LINUX-1.5.3-4.0.22.3 (OFED-1.5.3-4.0.22):
mlx4_0/1:
phys state: 5: LinkUp
rate: 56 Gb/sec (4X FDR)
PCI: Gen3
SymbolErrorCounter: 0
PortRcvErrors: 0
IB HCA FW Installed: 2.11.500
IB HCA FW Active: 2.11.500
mlx4_core set_4k_mtu: 0
mlx4_core log_num_mtt: 20
mlx4_core log_mtts_per_seg: 7
IPoIB Mode: connected
IPoIB MTU: 65520
IPoIB recv_queue_size: 8192
IPoIB send_queue_size: 8192
Firmware installed: 2.30.3200
Firmware active: 2.11.1260
Author: Brian Finley
EOF
@ -120,43 +145,89 @@ case "$NR" in
;;
esac
if [ -z $THINGY ]; then
# Match everything if nothing is specified
THINGY="."
fi
xdsh $NR -t3 '
echo -n "OFED: " ; ofed_info | head -n 1
ibstatus | grep -B7 InfiniBand | egrep "(phys state|rate|device)" | perl -pi -e "s/^\s+/ /; s|Infiniband device .(.*). port (\d+).*|\$1/\$2:|;"
HCA_PCI_ID=$(lspci | egrep "Network controller.*Mellanox" | sed "s/ .*//")
PCI_SPEED=$(lspci -vvvxxx -s $HCA_PCI_ID | egrep "^70: " | perl -pi -e "s/^70: [0-9]+ [0-9]+ (\d+).*/\$1/")
echo -n "PCI: "
if [ "$PCI_SPEED" == 83 ]; then
echo -n Gen3
elif [ "$PCI_SPEED" == 82 ]; then
echo -n Gen2
echo -n "OFED Version: " ; ofed_info | head -n 1
if [ ! -d /sys/class/infiniband ]; then
echo "No InfiniBand devices found."
else
echo -n Dunno
HCAs=$(cd /sys/class/infiniband && /bin/ls)
for HCA in $HCAs
do
echo $HCA
HCA_PCI_ID=$(lspci | egrep "Network controller.*Mellanox" | sed "s/ .*//")
PCI_SPEED=$(lspci -vvvxxx -s $HCA_PCI_ID | egrep "^70: " | perl -pi -e "s/^70: [0-9]+ [0-9]+ (\d+).*/\$1/")
echo -n " PCI: "
if [ "$PCI_SPEED" == 83 ]; then
echo Gen3
elif [ "$PCI_SPEED" == 82 ]; then
echo Gen2
else
echo Dunno
fi
echo -n " Firmware installed: "; mstflint -d $HCA q | grep "FW Version" | sed "'s/FW Version: *//'"
echo -n " Firmware active: "; cat /sys/class/infiniband/$HCA/fw_ver
MODULE=mlx4_core
echo -n " log_num_mtt: " ; cat /sys/module/$MODULE/parameters/log_num_mtt
echo -n " log_mtts_per_seg: " ; cat /sys/module/$MODULE/parameters/log_mtts_per_seg
for PORT in $(cd /sys/class/infiniband/$HCA/ports/ && /bin/ls)
do
LINK_LAYER=$(cat /sys/class/infiniband/$HCA/ports/$PORT/link_layer)
echo -n " Port $PORT: $LINK_LAYER"
if [ "$LINK_LAYER" = "InfiniBand" ]; then
for i in phys_state state rate
do
echo -n " $i: "
cat /sys/class/infiniband/$HCA/ports/$PORT/$i
done
for i in symbol_error port_rcv_errors
do
echo -n " $i: "
cat /sys/class/infiniband/$HCA/ports/$PORT/counters/$i
done
else
for i in phys_state state rate
do
echo -n " $i: "
cat /sys/class/infiniband/$HCA/ports/$PORT/$i
done
fi
done
done
echo
echo " IPoIB"
file=recv_queue_size ; echo -n " $file: " ; cat /sys/module/ib_ipoib/parameters/$file
file=send_queue_size ; echo -n " $file: " ; cat /sys/module/ib_ipoib/parameters/$file
for IFACE in $(cd /sys/class/net/ && /bin/ls -d ib*)
do
echo " $IFACE:"
echo -n " Mode: " ; cat /sys/class/net/ib0/mode
echo -n " MTU: " ; cat /sys/class/net/ib0/mtu
echo -n " Mode: " ; cat /sys/class/net/ib0/operstate
done
fi
echo
' | perl -pi -e 's/(ssh: connect to host) \S+ (.*)/$1 $2/' | egrep -i "$THINGY"
perfquery | egrep "(PortRcvErrors|SymbolErrorCounter)" | perl -pi -e "s/\.+/ /g"
#for HCA in $( lspci -xxxvvv | grep Net | grep Mell | sed "'s/ .*//'" )
#do
# echo -n "IB HCA FW Installed: " ; mstflint -d $HCA q | grep FW | sed "'s/.*: *//'"
#done
#for CA in $( ibstat -l )
#do
# ibstat $CA | grep -q InfiniBand && ibstat $CA | grep Firmware | sed "'s/.*: *//'" | xargs echo "IB HCA FW Active: "
#done
for HCA in $( lspci -xxxvvv | grep Net | grep Mell | sed "'s/ .*//'" )
do
echo -n "IB HCA FW Installed: " ; mstflint -d $HCA q | grep FW | sed "'s/.*: *//'"
done
for CA in $( ibstat -l )
do
ibstat $CA | grep -q InfiniBand && ibstat $CA | grep Firmware | sed "'s/.*: *//'" | xargs echo "IB HCA FW Active: "
done
# mlx4_core
MODULE=mlx4_core
MLX4_CORE_PARAMS="set_4k_mtu log_num_mtt log_mtts_per_seg"
for param in $MLX4_CORE_PARAMS
do
echo -n "mlx4_core $param: " ; cat /sys/module/$MODULE/parameters/$param
done
echo -n "IPoIB Mode: " ; cat /sys/class/net/ib0/mode
echo -n "IPoIB MTU: " ; cat /sys/class/net/ib0/mtu
file=recv_queue_size ; echo -n "IPoIB $file: " ; cat /sys/module/ib_ipoib/parameters/$file
file=send_queue_size ; echo -n "IPoIB $file: " ; cat /sys/module/ib_ipoib/parameters/$file
' | perl -pi -e 's/(ssh: connect to host) \S+ (.*)/$1 $2/'