From d8030192523a9e3a5673fefa65e6040122a8c72e Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Fri, 27 Feb 2009 09:46:46 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/PPCcli.pm | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/perl-xCAT/xCAT/PPCcli.pm b/perl-xCAT/xCAT/PPCcli.pm index 91b1abcbc..4b6608771 100644 --- a/perl-xCAT/xCAT/PPCcli.pm +++ b/perl-xCAT/xCAT/PPCcli.pm @@ -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"; + } } #####################################