noderange exclusion through site attribute excludenodes
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9267 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
084464ecad
commit
879480fef7
@ -509,7 +509,12 @@ sub noderange {
|
||||
$missingnodes=[];
|
||||
#We for now just do left to right operations
|
||||
my $range=shift;
|
||||
my $verify = (scalar(@_) == 1 ? shift : 1);
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
|
||||
#excludenodes attribute in site table,
|
||||
#these nodes should be excluded for any xCAT commands
|
||||
my $exsitenode = (scalar(@_) >= 1 ? shift : 1);
|
||||
|
||||
unless ($nodelist) {
|
||||
$nodelist =xCAT::Table->new('nodelist',-create =>1);
|
||||
$nodelist->_set_use_cache(0); #TODO: a more proper external solution
|
||||
@ -573,6 +578,27 @@ sub noderange {
|
||||
|
||||
} # end of main while loop
|
||||
|
||||
|
||||
# Exclude the nodes in site attribute excludenodes?
|
||||
if ($exsitenode) {
|
||||
my $badnoderange = 0;
|
||||
my @badnodes = ();
|
||||
my $sitetab = xCAT::Table->new('site',-create=>0);
|
||||
if ($sitetab) {
|
||||
my ($ref) = $sitetab->getAttribs({key => 'excludenodes'}, 'value');
|
||||
if ($ref and $ref->{value}) {
|
||||
$badnoderange = $ref->{value};
|
||||
# use the exsitenode argument to exit recursion
|
||||
@badnodes = noderange($badnoderange, 1, 0);
|
||||
foreach my $bnode (@badnodes) {
|
||||
if (!$delnodes{$bnode}) {
|
||||
$delnodes{$bnode} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Now remove all the exclusion nodes
|
||||
foreach (keys %nodes) {
|
||||
if ($delnodes{$_}) {
|
||||
|
@ -774,6 +774,10 @@ site => {
|
||||
" events to if the primary HMC is down.\n\n".
|
||||
" enableASMI: (yes/1 or no/0). If yes, ASMI method will be used after fsp-api. If no,\n".
|
||||
" when fsp-api is used, ASMI method will not be used. Default is no.\n\n".
|
||||
" excludenodes: A set of comma separated nodes and/or groups that would automatically\n".
|
||||
" be subtracted from any noderange, it can be used for excluding some\n".
|
||||
" failed nodes for any xCAT commands. See the 'noderange' manpage for\n".
|
||||
" details on supported formats.\n\n".
|
||||
" forwarders: The DNS servers at your site that can provide names outside of the\n".
|
||||
" cluster. The DNS on the management node will forward requests it\n".
|
||||
" does not know to these servers.\n\n".
|
||||
|
Loading…
Reference in New Issue
Block a user