added a site table attribute 'nonodestatus' so that the node status updates can be turned off during the node deployment, node discovery and node power on/off
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2961 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
ad1e364bea
commit
cf1eb5011c
@ -532,6 +532,7 @@ site => {
|
||||
" master:\tThe hostname of the xCAT management node.\n\n".
|
||||
" maxssh:\tThe max # of SSH connections for hw ctrl purposes to PPC hw.\n\n".
|
||||
" nameservers:\tA comma delimited list of DNS servers for the cluster - often the xCAT management node.\n\n".
|
||||
" nonodestatus:\tIf set to 1, the nodelist.status column will not be updated during the node deployment, node discovery and power operation.\n\n".
|
||||
" ntpservers:\tA comma delimited list of NTP servers for the cluster - often the xCAT management node.\n\n".
|
||||
" ppcmaxp:\tThe max # of processes for PPC hw ctrl.\n\n".
|
||||
" ppcretry:\tThw max # of PPC hw connection attempts before failing.\n\n".
|
||||
|
@ -127,9 +127,17 @@ sub process_command {
|
||||
my %nodestat=();
|
||||
my $check=0;
|
||||
my $newstat;
|
||||
my $global_check=1;
|
||||
if ($sitetab) {
|
||||
(my $ref) = $sitetab->getAttribs({key => 'nonodestatus'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
if ($ref->{value} =~ /1|y|Y/) { $global_check=0; }
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->{command} eq 'rpower') {
|
||||
my $subcommand=$request->{op};
|
||||
if (($subcommand ne 'stat') && ($subcommand ne 'status') && ($subcommand ne 'state')) {
|
||||
if (($global_check) && ($subcommand ne 'stat') && ($subcommand ne 'status') && ($subcommand ne 'state')) {
|
||||
$check=1;
|
||||
my $noderange = $request->{node};
|
||||
my @allnodes=@$noderange;
|
||||
|
@ -2826,8 +2826,18 @@ sub dompa {
|
||||
my $check=0;
|
||||
my $nsh={};
|
||||
|
||||
my $global_check=1;
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
if ($sitetab) {
|
||||
(my $ref) = $sitetab->getAttribs({key => 'nonodestatus'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
if ($ref->{value} =~ /1|y|Y/) { $global_check=0; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($command eq 'rpower') {
|
||||
if (($args->[0] ne 'stat') && ($args->[0] ne 'status')) {
|
||||
if (($global_check) && ($args->[0] ne 'stat') && ($args->[0] ne 'status')) {
|
||||
$check=1;
|
||||
my @allnodes=keys %{$mpahash->{$mpa}->{nodes}};
|
||||
|
||||
@ -2838,6 +2848,8 @@ sub dompa {
|
||||
}
|
||||
}
|
||||
}
|
||||
#print "\nglobal_check=$global_check, check=$check\n";
|
||||
|
||||
|
||||
foreach $node (sort (keys %{$mpahash->{$mpa}->{nodes}})) {
|
||||
$curn = $node;
|
||||
|
@ -5880,8 +5880,16 @@ sub process_request {
|
||||
my %nodestat=();
|
||||
my $check=0;
|
||||
my $newstat;
|
||||
my $global_check=1;
|
||||
if ($sitetab) {
|
||||
(my $ref) = $sitetab->getAttribs({key => 'nonodestatus'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
if ($ref->{value} =~ /1|y|Y/) { $global_check=0; }
|
||||
}
|
||||
}
|
||||
|
||||
if ($command eq 'rpower') {
|
||||
if (($extrargs->[0] ne 'stat') && ($extrargs->[0] ne 'status') && ($extrargs->[0] ne 'state')) {
|
||||
if (($global_check) && ($extrargs->[0] ne 'stat') && ($extrargs->[0] ne 'status') && ($extrargs->[0] ne 'state')) {
|
||||
$check=1;
|
||||
my @allnodes;
|
||||
foreach (@donargs) { push(@allnodes, $_->[0]); }
|
||||
@ -5905,6 +5913,7 @@ sub process_request {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#foreach (keys %nodestat) { print "node=$_,status=" . $nodestat{$_} ."\n"; } #Ling:remove
|
||||
|
||||
my $children = 0;
|
||||
|
@ -894,9 +894,17 @@ sub process_request {
|
||||
my %nodestat=();
|
||||
my $check=0;
|
||||
my $newstat;
|
||||
my $global_check=1;
|
||||
if ($sitetab) {
|
||||
(my $ref) = $sitetab->getAttribs({key => 'nonodestatus'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
if ($ref->{value} =~ /1|y|Y/) { $global_check=0; }
|
||||
}
|
||||
}
|
||||
|
||||
if ($command eq 'rpower') {
|
||||
my $subcommand=$exargs[0];
|
||||
if (($subcommand ne 'stat') && ($subcommand ne 'status')) {
|
||||
if (($global_check) && ($subcommand ne 'stat') && ($subcommand ne 'status')) {
|
||||
$check=1;
|
||||
my @allnodes=@$noderange;
|
||||
if ($subcommand eq 'off') { $newstat=$::STATUS_POWERING_OFF; }
|
||||
|
@ -754,9 +754,18 @@ sub process_request {
|
||||
my %nodestat=();
|
||||
my $check=0;
|
||||
my $newstat;
|
||||
my $global_check=1;
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
if ($sitetab) {
|
||||
(my $ref) = $sitetab->getAttribs({key => 'nonodestatus'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
if ($ref->{value} =~ /1|y|Y/) { $global_check=0; }
|
||||
}
|
||||
}
|
||||
|
||||
if ($command eq 'rpower') {
|
||||
my $subcommand=$exargs[0];
|
||||
if (($subcommand ne 'stat') && ($subcommand ne 'status')) {
|
||||
if (($global_check) && ($subcommand ne 'stat') && ($subcommand ne 'status')) {
|
||||
$check=1;
|
||||
my @allnodes=@$noderange;
|
||||
if ($subcommand eq 'off') { $newstat=$::STATUS_POWERING_OFF; }
|
||||
|
@ -140,9 +140,16 @@ if (-f $scriptname)
|
||||
}
|
||||
|
||||
if (@ARGV<1) {
|
||||
if (&updateflag($nodesetstat) != 0) {
|
||||
print "$::sdate xcataixpost: Failed to update the xCAT server.\n";
|
||||
print $::LOG_FILE "$::sdate xcataixpost: Failed to update the xCAT server..\n";
|
||||
my $update=1;
|
||||
if (-f $scriptname) {
|
||||
my $CNS=`grep NONODESTATUS= $scriptname`;
|
||||
if ((!$?) && ($CNS =~ /\'1\'|\'Y\'|\'y\'/)) { $update=0;} #only update is nonodestatus is not set in the site table
|
||||
}
|
||||
if ($update) {
|
||||
if (&updateflag($nodesetstat) != 0) {
|
||||
print "$::sdate xcataixpost: Failed to update the xCAT server.\n";
|
||||
print $::LOG_FILE "$::sdate xcataixpost: Failed to update the xCAT server..\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#called by updatenode, infrom user it is done
|
||||
|
@ -94,7 +94,10 @@ fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
#notify the server that we are done with netbooting
|
||||
echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript
|
||||
CNS=`grep NONODESTATUS= /tmp/mypostscript |awk -F = '{print $2}'`
|
||||
if [ -z "$CNS" ] || [ $CNS != "'1'" -a $CNS != "'Y'" -a $CNS != "'y'" ]; then
|
||||
echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript
|
||||
fi
|
||||
fi
|
||||
|
||||
DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' /tmp/mypostscript`
|
||||
|
Loading…
Reference in New Issue
Block a user