2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-22 20:31:09 +00:00

Merge pull request #2479 from stanford-rc/enhance_mtm

Enhance mtm discovery for non-IBM hardware
This commit is contained in:
zet809
2017-03-05 23:13:35 +08:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -72,6 +72,12 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86
MTM=VMware
else
MTM=`cat /sys/devices/virtual/dmi/id/product_name|awk -F'[' '{print $2}'|awk -F']' '{print $1}'`
if [ -z "$MTM" ]; then
FRU=`ipmitool fru print 0`
if [ $? -eq 0 ]; then
MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name/ {n=$2} END {print m":"n}'`
fi
fi
SERIAL=`cat /sys/devices/virtual/dmi/id/product_serial`
fi
CPUCOUNT=`cat /proc/cpuinfo |grep "model name"|wc -l`

View File

@@ -921,6 +921,13 @@ sub bmcdiscovery_ipmi {
$serial = $2;
last;
}
if (($fru_output =~ /Product Manufacturer\s+:\s+(.*?)\s+P.*?roduct Name\s+:\s+(.*?)\s+P.*?roduct Serial\s+:\s+(\S+)/)) {
$mtm = $1.":".$2;
$serial = $3;
last;
}
}
}
@@ -939,6 +946,7 @@ sub bmcdiscovery_ipmi {
if ($mtm and $serial) {
$node = "node-$mtm-$serial";
$node =~ s/(.*)/\L$1/g;
$node =~ s/[\s:\._]/-/g;
}
} elsif ($output =~ /error : unauthorized name/) {
xCAT::MsgUtils->message("E", { data => ["BMC username is incorrect for $ip"] }, $::CALLBACK);