diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 25446d0e1..5593dcdee 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -513,11 +513,31 @@ sub process_request { #if not shared tftpdir, then filter, otherwise, set up everything if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command @nodes = (); + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + my $cur_xmaster = pop @hostinfo; + xCAT::MsgUtils->trace(0, "d", "xnba: running on $cur_xmaster"); + + # Get current server managed node list + my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN"); + my %managed = {}; + foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; } + foreach (@rnodes) { if (xCAT::NetworkUtils->nodeonmynet($_)) { push @nodes, $_; } else { - xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); + my $msg = "grub2 configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster"; + if ( $cur_xmaster ) { + $msg .= ": $cur_xmaster"; + } + if ( exists( $managed{$_} ) ) { + # report error when it is under my control but I cannot handle it. + my $rsp; + $rsp->{data}->[0] = $msg; + xCAT::MsgUtils->message("E", $rsp, $callback); + } else { + xCAT::MsgUtils->message("S", $msg); + } } } } else { diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index f99b41c92..ffa3b7842 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -404,11 +404,31 @@ sub process_request { #if not shared tftpdir, then filter, otherwise, set up everything if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command @nodes = (); + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + my $cur_xmaster = pop @hostinfo; + xCAT::MsgUtils->trace(0, "d", "xnba: running on $cur_xmaster"); + + # Get current server managed node list + my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN"); + my %managed = {}; + foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; } + foreach (@rnodes) { if (xCAT::NetworkUtils->nodeonmynet($_)) { push @nodes, $_; } else { - xCAT::MsgUtils->message("S", "$_: petitboot netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); + my $msg = "petitboot configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster"; + if ( $cur_xmaster ) { + $msg .= ": $cur_xmaster"; + } + if ( exists( $managed{$_} ) ) { + # report error when it is under my control but I cannot handle it. + my $rsp; + $rsp->{data}->[0] = $msg; + xCAT::MsgUtils->message("E", $rsp, $callback); + } else { + xCAT::MsgUtils->message("S", $msg); + } } } } else { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index fc485dd4e..eba36892d 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -449,11 +449,33 @@ sub process_request { #if not shared, then help sync up if ($::XNBA_request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command @nodes = (); + my @hostinfo = xCAT::NetworkUtils->determinehostname(); + my $cur_xmaster = pop @hostinfo; + xCAT::MsgUtils->trace(0, "d", "xnba: running on $cur_xmaster"); + + # Get current server managed node list + my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN"); + my %managed = {}; + foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; } + + # Whatever the node managed by this xcatmaster explicitly, if the node in same subnet, we need to handle its boot configuration files foreach (@rnodes) { if (xCAT::NetworkUtils->nodeonmynet($_)) { push @nodes, $_; } else { - xCAT::MsgUtils->message("S", "$_: xnba netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); + my $msg = "xnba configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster"; + if ( $cur_xmaster ) { + $msg .= ": $cur_xmaster"; + } + if ( exists( $managed{$_} ) ) { + # report error when it is under my control but I cannot handle it. + my $rsp; + $rsp->{data}->[0] = $msg; + xCAT::MsgUtils->message("E", $rsp, $::XNBA_callback); + } else { + xCAT::MsgUtils->message("S", $msg); + } + } } } else {