diff --git a/xCAT-server/lib/xcat/plugins/vsmppxe.pm b/xCAT-server/lib/xcat/plugins/vsmppxe.pm index 912c12cb9..f40655eb5 100644 --- a/xCAT-server/lib/xcat/plugins/vsmppxe.pm +++ b/xCAT-server/lib/xcat/plugins/vsmppxe.pm @@ -6,6 +6,7 @@ use Socket; use File::Copy; use Getopt::Long; use xCAT::MsgUtils; +use xCAT::ServiceNodeUtils; use xCAT::TableUtils qw(get_site_attribute); my $addkcmdlinehandled; @@ -210,6 +211,7 @@ sub preprocess_request { my $callback1 = shift; my $command = $req->{command}->[0]; my $sub_req = shift; + my $nodes = $req->{node}; my @args=(); if (ref($req->{arg})) { @args=@{$req->{arg}}; @@ -254,10 +256,22 @@ sub preprocess_request { return; } - #my $sent = $stab->getAttribs({key=>'sharedtftp'},'value'); my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp"); my $t_entry = $entries[0]; if ( defined($t_entry) and ($t_entry == 0 or $t_entry =~ /no/i)) { + # check for computenodes and servicenodes from the noderange, if so error out + my @SN; + my @CN; + xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN); + if ((@SN > 0) && (@CN >0 )) { # there are both SN and CN + my $rsp; + $rsp->{data}->[0] = + "Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n"; + xCAT::MsgUtils->message("E", $rsp, $callback1); + return; + + } + $req->{'_disparatetftp'}=[1]; if ($req->{inittime}->[0]) { return [$req];