From 87ff38aad14e0f09c20e7c0983a18f975f926d97 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 5 Nov 2010 13:29:34 +0000 Subject: [PATCH] -Restore discovery nics forced nic treatment git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8060 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodediscover.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index f5eed2c80..f532461e8 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -155,6 +155,7 @@ sub process_request { } my $nrtab; my @discoverynics; + my @forcenics; #list of 'eth' style interface names to require to come up on post-discovery client dhcp restart if (defined($request->{arch})) { #Set the architecture in nodetype. If 32-bit only x86 or ppc detected, overwrite. If x86_64, only set if either not set or not an x86 family my $typetab=xCAT::Table->new("nodetype",-create=>1); @@ -205,10 +206,12 @@ sub process_request { (my $driver,my $index) = split /:/,$nic; if ($driver eq $ifinfo[0] and $index == ($bydriverindex{$driver}-1)) { $forcenic=1; #force nic to be put into database + push @forcenics,$ifinfo[1]; last; } } else { #simple 'eth2' sort of argument if ($nic eq $ifinfo[1]) { + push @forcenics,$ifinfo[1]; $forcenic=1; last; } @@ -238,7 +241,11 @@ sub process_request { $nrtab->setNodeAttribs($node,{nfsserver=>xCAT::Utils->my_ip_facing($hosttag)}); } $usednames{$hosttag}=1; + if ($hosttag eq $node) { + $macstring .= $currmac."|"; + } else { $macstring .= $currmac."!".$hosttag."|"; + } } else { if ($forcenic == 1) { $macstring .= $currmac."|"; } else { $macstring .= $currmac."!*NOIP*|"; } } @@ -264,6 +271,10 @@ sub process_request { } + my $restartstring = "restart"; + if (scalar @forcenics > 0) { + $restartstring .= " (".join("|",@forcenics).")"; + } #now, notify the node to continue life my $sock = new IO::Socket::INET ( PeerAddr => $ip, @@ -272,7 +283,7 @@ sub process_request { Proto => 'tcp' ); unless ($sock) { syslog("err","Failed to notify $ip that it's actually $node."); return; } #Give up if the node won't hear of it. - print $sock "restart"; + print $sock $restartstring; close($sock); syslog("info","$node has been discovered"); }