Fixed the issue that if nodename in xcat database is not the same with lpar name, rnetboot will fail.

Root cause: rnetboot will resolve the lpar name from hmc in order to setup a full lpar_netboot command.  But rnetboot will also use this lpar name in xcat database to resolve the network, which will definitely fail.
Fix: pass the nodename to xcat database instead of lparname.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2715 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2009-02-11 06:32:58 +00:00
parent 2ded87c984
commit 5ee13233fc

View File

@ -584,6 +584,7 @@ sub lpar_netboot {
my $timeout = my $t = @$exp[7]*10;
my $cmd = "lpar_netboot -t ent -f";
my $gateway = $opt->{G};
my $node = @$d[6];
#####################################
# Power6 HMCs (V7) do not support
@ -637,11 +638,11 @@ sub lpar_netboot {
my @nodelist = split(',', $_->{'node'});
my @oslist = split(',', $_->{'os'});
my $osname = "AIX";
if (grep(/^$name$/, @nodelist))
if (grep(/^$node$/, @nodelist))
{
if (!grep(/^$osname$/, @oslist) || !xCAT::Utils->isAIX())
{
`xdsh $name "shutdown -h now" 2>/dev/null`;
`xdsh $node "shutdown -h now" 2>/dev/null`;
last;
}
}
@ -665,14 +666,14 @@ sub lpar_netboot {
# Network specified (-D ping test)
#####################################
if ( exists( $opt->{S} )) {
my %nethash = xCAT::DBobjUtils->getNetwkInfo( [$name] );
my %nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
#####################################
# Network attributes undefined
#####################################
if ( !%nethash ) {
return( [RC_ERROR,"Cannot get network information for $name"] );
return( [RC_ERROR,"Cannot get network information for $node"] );
}
my $netmask = $nethash{$name}{mask};
my $netmask = $nethash{$node}{mask};
$cmd.= (!defined( $mac )) ? " -D" : "";
$cmd.= " -s auto -d auto -S $opt->{S} -G $opt->{G} -C $opt->{C} -K $netmask";
}