The original logic to rnetboot/getmacs linux nodes takes too much time, since xdsh will wait there for some time if the nodes are not running.

Now just FORCE lpar shutdown if the nodes are running Linux.  

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2811 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2009-02-27 09:46:46 +00:00
parent 2040541067
commit d803019252

View File

@ -618,36 +618,40 @@ sub lpar_netboot {
$cmd.= " -x -v";
}
#####################################
# Force LPAR shutdown (-f specified)
# Or send shutdown request to non-AIX
# LPARs
# Force LPAR shutdown if -f specified
#####################################
if ( exists( $opt->{f} )) {
$cmd.= " -i";
} else {
#################################
# Determine if LPAR and mgmt node
# are AIX or not.
################################
# Force LPAR shutdown if LPAR is
# running Linux
#################################
my $table = "nodetype";
my $intable = 0;
my @TableRowArray = xCAT::DBobjUtils->getDBtable($table);
if (defined(@TableRowArray))
{
foreach (@TableRowArray)
{
if ( defined(@TableRowArray) ) {
foreach ( @TableRowArray ) {
my @nodelist = split(',', $_->{'node'});
my @oslist = split(',', $_->{'os'});
my $osname = "AIX";
if (grep(/^$node$/, @nodelist))
{
if (!grep(/^$osname$/, @oslist) || !xCAT::Utils->isAIX())
{
`xdsh $node "shutdown -h now" 2>/dev/null`;
last;
if ( grep(/^$node$/, @nodelist) ) {
if ( !grep(/^$osname$/, @oslist) ) {
$cmd.= " -i";
}
$intable = 1;
last;
}
}
}
#################################
# Force LPAR shutdown if LPAR OS
# type is not assigned in table
# but mnt node is running Linux
#################################
if ( xCAT::Utils->isLinux() && $intable == 0 ) {
$cmd.= " -i";
}
}
#####################################