From b8251925d9d1c3b58b6072236cd876cd5b5a0777 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Mon, 10 Nov 2008 02:49:15 +0000 Subject: [PATCH] Fixed the issue that rnetboot and getmacs commands coundn't succeed when the LPARs are still running. Defect 2022227[https://sourceforge.net/tracker/index.php?func=detail&aid=2022227&group_id=208749&atid=1006945] git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2488 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCcli.pm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/PPCcli.pm b/perl-xCAT/xCAT/PPCcli.pm index b579e64d6..06811ec31 100644 --- a/perl-xCAT/xCAT/PPCcli.pm +++ b/perl-xCAT/xCAT/PPCcli.pm @@ -613,11 +613,39 @@ sub lpar_netboot { $cmd.= " -x -v"; } ##################################### - # Force LPAR shutdown + # Force LPAR shutdown (-f specified) + # Or send shutdown request to non-AIX + # LPARs ##################################### if ( exists( $opt->{f} )) { $cmd.= " -i"; + } else { + ################################# + # Determine if LPAR and mgmt node + # are AIX or not. + ################################ + my $table = "nodetype"; + my @TableRowArray = xCAT::DBobjUtils->getDBtable($table); + if (defined(@TableRowArray)) + { + foreach (@TableRowArray) + { + my @nodelist = split(',', $_->{'node'}); + my @oslist = split(',', $_->{'os'}); + my $nodename = @$d[6]; + my $osname = "AIX"; + if (grep(/^$nodename$/, @nodelist)) + { + if (!grep(/^$osname$/, @oslist) || !xCAT::Utils->isAIX()) + { + `xdsh $nodename "shutdown -h now" 2>/dev/null`; + last; + } + } + } + } } + ##################################### # Get MAC-address or network boot #####################################