From 982ac79304da4058e53ee4695551e94819bd08c5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 25 Sep 2009 20:27:52 +0000 Subject: [PATCH] -Fix xNBA plugin name -Make nodeset boot when iscsi is indicated invoke hdboot instead of exit git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4232 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xnba.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 2ea8727d4..b4d2b3da4 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -1,5 +1,5 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -package xCAT_plugin::pxe; +package xCAT_plugin::xnba; use Sys::Syslog; use Socket; use File::Copy; @@ -76,6 +76,7 @@ sub setstate { my %bphash = %{shift()}; my %chainhash = %{shift()}; my %machash = %{shift()}; + my %iscsihash = %{shift()}; my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); unless ($addkcmdlinehandled->{$node}) { #Tag to let us know the plugin had a special syntax implemented for addkcmdline if ($kern->{addkcmdline}) { #Implement the kcmdline append here for @@ -108,7 +109,12 @@ sub setstate { print $pcfg "#".$cref->{currstate}."\n"; } if ($cref and $cref->{currstate} eq "boot") { - print $pcfg "exit\n"; + my $ient = $iscsihash{$node}->[0]; + if ($ient and $ient->{server} and $ient->{target}) { + print $pcfg "hdboot\n"; + } else { + print $pcfg "exit\n"; + } close($pcfg); } elsif ($kern and $kern->{kernel}) { if ($kern->{kernel} =~ /!/) { #TODO: deprecate this, do stateless Xen like stateless ESXi @@ -435,6 +441,11 @@ sub process_request { my $mactab = xCAT::Table->new('mac'); #to get all the hostnames my %bphash = %{$bptab->getNodesAttribs(\@nodes,[qw(kernel initrd kcmdline addkcmdline)])}; my %chainhash = %{$chaintab->getNodesAttribs(\@nodes,[qw(currstate)])}; + my %iscsihash; + my $iscsitab = xCAT::Table->new('iscsi'); + if ($iscsitab) { + %iscsihash = %{$iscsitab->getNodesAttribs(\@nodes,[qw(server target)])}; + } my %machash = %{$mactab->getNodesAttribs(\@nodes,[qw(mac)])}; mkpath($tftpdir."/xcat/xnba/nodes/"); foreach (@nodes) { @@ -444,7 +455,7 @@ sub process_request { $response{node}->[0]->{data}->[0]= getstate($_); $callback->(\%response); } elsif ($args[0]) { #If anything else, send it on to the destiny plugin, then setstate - ($rc,$errstr) = setstate($_,\%bphash,\%chainhash,\%machash); + ($rc,$errstr) = setstate($_,\%bphash,\%chainhash,\%machash,\%iscsihash); if ($rc) { $response{node}->[0]->{errorcode}->[0]= $rc; $response{node}->[0]->{errorc}->[0]= $errstr;