mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	-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
This commit is contained in:
		| @@ -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"); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user