From a5857d7c5b4cb26f99453493393e88f4e49bbe46 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 7 May 2008 21:15:13 +0000 Subject: [PATCH] -Have NFSsn.pm set up bind mounts for ftp to work -Have nodediscover populate noderes.primarynic with a guess if admin omitted git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1327 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/NFSsn.pm | 5 +++++ xCAT-server-2.0/lib/xcat/plugins/nodediscover.pm | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/NFSsn.pm b/xCAT-server-2.0/lib/xcat/plugins/NFSsn.pm index 624d15d4d..d2525b0db 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/NFSsn.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/NFSsn.pm @@ -7,6 +7,7 @@ use xCAT::Table; use xCAT::Utils; use xCAT::MsgUtils; +use File::Path; use Getopt::Long; #------------------------------------------------------- @@ -103,6 +104,10 @@ sub setup_NFS my $arch; # make sure vsftpd is started + mkpath "/var/ftp/install"; + mkpath "/var/ftp/tftpboot"; + system "mount -o bind $installdir /var/ftp/install"; + system "mount -o bind /tftpboot /var/ftp/tftpboot"; my $cmd = "service vsftpd start"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) diff --git a/xCAT-server-2.0/lib/xcat/plugins/nodediscover.pm b/xCAT-server-2.0/lib/xcat/plugins/nodediscover.pm index 516606297..a277388e3 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/nodediscover.pm @@ -102,6 +102,7 @@ sub process_request { $vpdtab->setNodeAttribs($node,{serial=>$request->{serial}->[0]}); } } + my $nrtab; 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); @@ -115,7 +116,7 @@ sub process_request { $typetab->setNodeAttribs($node,{arch=>$request->{arch}->[0]}); } my $currboot=''; - my $nrtab = xCAT::Table->new('noderes'); #Attempt to check and set if wrong the netboot method on discovery, if admin omitted + $nrtab = xCAT::Table->new('noderes'); #Attempt to check and set if wrong the netboot method on discovery, if admin omitted (my $rent) = $nrtab->getNodeAttribs($node,'netboot'); if ($rent and $rent->{'netboot'}) { $currboot=$rent->{'netboot'}; @@ -141,6 +142,10 @@ sub process_request { my $netn = inet_ntoa(pack("N",$ipn & $mask)); my $hosttag = gethosttag($node,$netn,@ifinfo[1],\%usednames); if ($hosttag) { + (my $rent) = $nrtab->getNodeAttribs($node,'primarynic'); + unless ($rent and $rent->{primarynic}) { #if primarynic not set, set it to this nic + $nrtab->setNodeAttribs($node,{primarynic=>@ifinfo[1]}); + } $usednames{$hosttag}=1; $macstring .= $ifinfo[2]."!".$hosttag."|"; } else {