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
This commit is contained in:
		| @@ -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 | ||||
|     ##################################### | ||||
|   | ||||
		Reference in New Issue
	
	Block a user