For auto created bmc, add it to hosts.otherinterfaces instead of creating a new entry in the hosts table for bmc individually. That means auto created bmc will not be a individual node.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16612 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
f341aa50ab
commit
43a7d86394
@ -187,11 +187,20 @@ sub findme {
|
||||
nodediscoverstop($callback, undef, "bmc ips");
|
||||
return;
|
||||
}
|
||||
$hosttab->setNodeAttribs($bmcname, {ip => $bmcip});
|
||||
# for auto created bmc, just add it to hosts.otherinterfaces instead of adding a new bmc node
|
||||
my $otherif = $hosttab->getNodeAttribs($node, ['otherinterfaces']);
|
||||
my $updateotherif;
|
||||
if ($otherif && defined ($otherif->{'otherinterfaces'})) {
|
||||
$updateotherif .= ",$bmcname:$bmcip";
|
||||
} else {
|
||||
$updateotherif = "$bmcname:$bmcip";
|
||||
}
|
||||
$hosttab->setNodeAttribs($node, {otherinterfaces => $updateotherif});
|
||||
$hosttab->commit();
|
||||
|
||||
# set the bmc to the ipmi table
|
||||
$ipmitab->setNodeAttribs($node, {bmc => $bmcname});
|
||||
$ipmitab->commit();
|
||||
}
|
||||
|
||||
# update the host ip pair to /etc/hosts, it's necessary for discovered and makedhcp commands
|
||||
@ -256,21 +265,12 @@ sub findme {
|
||||
}
|
||||
if (defined ($param{'groups'})) {
|
||||
$nltab->setNodeAttribs($node, {groups=>$param{'groups'}});
|
||||
unless ($skipbmcip) {
|
||||
$nltab->setNodeAttribs($bmcname, {groups=>$param{'groups'}.",bmc"});
|
||||
}
|
||||
} else {
|
||||
# just set the groups attribute when there was no groups value was set
|
||||
my $nlent = $nltab->getNodeAttribs($node,['groups']);
|
||||
if (!$nlent || !$nlent->{'groups'}) {
|
||||
$nltab->setNodeAttribs($node, {groups=>"all"});
|
||||
}
|
||||
unless ($skipbmcip) {
|
||||
$nlent = $nltab->getNodeAttribs($bmcname,['groups']);
|
||||
if (!$nlent || !$nlent->{'groups'}) {
|
||||
$nltab->setNodeAttribs($bmcname, {groups=>"all,bmc"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# set the mgt for the node
|
||||
|
Loading…
Reference in New Issue
Block a user