mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-04 20:17:55 +00:00
fix(template): honour installnic when the kickstart names the install device
noderes.installnic names the adapter that deploys the operating system. The kickstart network line ignored it and named the adapter from mac.mac alone, so a node that sets installnic got a kernel command line that obeys installnic and a kickstart that configures a different adapter. On a node with more than one adapter the installer then brings up the wrong one and cannot reach the repository. Name the device from the shared resolution, which gives the interface name when installnic or primarynic names one, and the address otherwise. A node that sets neither attribute keeps the address it has today. The unique local address still comes from the hardware address, because autoulaaddress builds the address from it.
This commit is contained in:
@@ -1052,13 +1052,23 @@ sub kickstartnetwork {
|
||||
unless ($mactab) { $tmplerr = "mac table should always exist prior to template processing when doing autoula"; return; }
|
||||
my $ent = $mactab->getNodeAttribs($node, ['mac'], prefetchcache => 1);
|
||||
unless ($ent and $ent->{mac}) { $tmplerr = "missing mac data for $node"; return; }
|
||||
my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac}, $node);
|
||||
$suffix = lc($suffix);
|
||||
my ($installnic, $primarynic);
|
||||
my $nrtab = xCAT::Table->new('noderes', -create => 0);
|
||||
if ($nrtab) {
|
||||
my $nrent = $nrtab->getNodeAttribs($node, [ 'installnic', 'primarynic' ], prefetchcache => 1);
|
||||
if ($nrent) {
|
||||
$installnic = $nrent->{installnic};
|
||||
$primarynic = $nrent->{primarynic};
|
||||
}
|
||||
}
|
||||
my $params = install_device_params($installnic, $primarynic, $ent->{mac}, $node);
|
||||
my $macaddr = defined($params->{mac}) ? lc($params->{mac}) : '';
|
||||
my $suffix = defined($params->{nicname}) ? $params->{nicname} : $macaddr;
|
||||
|
||||
if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
|
||||
unless ($hoststab) { $hoststab = xCAT::Table->new('hosts', -create => 1); }
|
||||
$line .= "static --device=$suffix --noipv4 --ipv6=";
|
||||
my $ulaaddr = autoulaaddress($suffix);
|
||||
my $ulaaddr = autoulaaddress($macaddr);
|
||||
$hoststab->setNodeAttribs($node, { ip => $ulaaddr });
|
||||
$line .= $ulaaddr;
|
||||
} elsif ($::XCATSITEVALS{managedaddressmode} =~ /static/) {
|
||||
|
||||
Reference in New Issue
Block a user