2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Merge branch 'lenovobuild2.14' of github.com:jjohnson42/xcat-core into lenovobuild2.14

This commit is contained in:
Jarrod Johnson
2019-11-19 15:40:55 -05:00
2 changed files with 82 additions and 35 deletions

View File

@@ -229,10 +229,12 @@ elif [ "$IPMIMFG" = "19046" -a "$XPROD" = "1287" ]; then
# Lenovo SR635/SR655
BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'`
if [ "$BMCPORT" = 0 ]; then
ipmitool raw 0x32 0x71 0 1 2
ipmitool raw 0x32 0x71 0 0 3
LANCHAN=1
LANCHAN=$(ipmitool raw 0x32 0x72 4 0 0|sed -e 's/^ 0//')
else
LANCHAN=8
ipmitool raw 0x32 0x71 0 0 0
LANCHAN=$(ipmitool raw 0x32 0x72 4 1 0|sed -e 's/^ 0//')
fi
ipmitool raw 0x3c 0x70 0 1
#USBSTATE=$(ipmitool raw 0x32 0xab)

View File

@@ -355,6 +355,12 @@ sub delnode
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
print $omshell "new host\n";
print $omshell
"set name = \"$hostname". "-infinibandcompatname\"\n"; #Find and destroy conflict name
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
if ($mac)
{
@@ -365,6 +371,14 @@ sub delnode
print $omshell "remove\n";
print $omshell "close\n";
}
if ($mac and length($mac) == 17) {
my $ibmac = substr($mac, 0, 8) . ":03:00" . substr($mac, 8);
print $omshell "new host\n";
print $omshell "set hardware-address = " . $ibmac . "\n"; #find and destroy mac conflict
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
}
if ($inetn)
{
my $ip;
@@ -777,6 +791,11 @@ sub addnode
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
print $omshell "new host\n";
print $omshell "set name = \"$hostname". "-infinibandcompatname\"\n"; #Find and destroy conflict name
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
if ($ip and $ip ne 'DENIED') {
print $omshell "new host\n";
print $omshell "set ip-address = $ip\n"; #find and destroy ip conflict
@@ -790,46 +809,72 @@ sub addnode
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
print $omshell "new host\n";
print $omshell "set name = \"$hostname\"\n";
print $omshell "set hardware-address = " . $mac . "\n";
print $omshell "set dhcp-client-identifier = " . $mac . "\n";
print $omshell "set hardware-type = $hardwaretype\n";
if ($ip eq "DENIED")
{ #Blacklist this mac to preclude confusion, give best shot at things working
print $omshell "set statements = \"deny booting;\"\n";
my $ibmac = 0;
if (length($mac) == 17) {
$ibmac = substr($mac, 0, 8) . ":03:00" . substr($mac, 8);
print $omshell "new host\n";
print $omshell "set hardware-address = " . $ibmac
. "\n"; #find and destroy mac conflict
print $omshell "open\n";
print $omshell "remove\n";
print $omshell "close\n";
}
else
my @hwtypes;
if ($hardwaretype == 1) {
@hwtypes = (1, 132);
} else {
@hwtypes = ($hardwaretype);
}
foreach my $hwtype (@hwtypes)
{
if ($ip and not ipIsDynamic($ip)) {
print $omshell "set ip-address = $ip\n";
} else {
# only if when ip is not blank, blank ip warning already done earlier in the code
if ($ip)
{
$callback->(
{
warning => [
"The ip address $ip of node $node overlaps with the DHCP dynamic range specified in networks table, will not add this ip address into dhcpd.leases file."
]
}
);
}
my $localname = $hostname;
my $localmac = $mac;
if ($hwtype == 132) {
$hwtype = 32;
$localname .= "-infinibandcompatname";
$localmac = substr($mac, 0, 8) . ":03:00" . substr($mac, 8);
}
if ($lstatements)
print $omshell "new host\n";
print $omshell "set name = \"$localname\"\n";
print $omshell "set hardware-address = " . $localmac . "\n";
print $omshell "set dhcp-client-identifier = " . $localmac . "\n";
print $omshell "set hardware-type = $hwtype\n";
if ($ip eq "DENIED")
{ #Blacklist this mac to preclude confusion, give best shot at things working
print $omshell "set statements = \"deny booting;\"\n";
}
else
{
$lstatements = 'ddns-hostname \"' . $node . '\"; send host-name \"' . $node . '\";' . $lstatements;
if ($ip and not ipIsDynamic($ip)) {
print $omshell "set ip-address = $ip\n";
} else {
} else {
$lstatements = 'ddns-hostname \"' . $node . '\"; send host-name \"' . $node . '\";';
# only if when ip is not blank, blank ip warning already done earlier in the code
if ($ip)
{
$callback->(
{
warning => [
"The ip address $ip of node $node overlaps with the DHCP dynamic range specified in networks table, will not add this ip address into dhcpd.leases file."
]
}
);
}
}
if ($lstatements)
{
$lstatements = 'ddns-hostname \"' . $node . '\"; send host-name \"' . $node . '\";' . $lstatements;
} else {
$lstatements = 'ddns-hostname \"' . $node . '\"; send host-name \"' . $node . '\";';
}
print $omshell "set statements = \"$lstatements\"\n";
}
print $omshell "set statements = \"$lstatements\"\n";
}
print $omshell "create\n";
print $omshell "close\n";
print $omshell "create\n";
print $omshell "close\n";
}
unless ($::XCATSITEVALS{externaldhcpservers}) {
unless (grep /#definition for host $node aka host $hostname/, @dhcpconf)
{