add conserveronhmc setting in site table to control if we use lpar_netboot script local or on hmc

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3453 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2009-05-27 07:52:18 +00:00
parent 5ae7b488a7
commit deb834218b
2 changed files with 35 additions and 8 deletions

View File

@ -306,11 +306,25 @@ sub rnetboot {
if ( !defined( $name )) {
return( [[$node,"Node not found, lparid=$lparid",RC_ERROR]] );
}
#########################################
# Manually perform boot.
#########################################
$result = do_rnetboot( $request, $d, $exp, $name, $node, \%opt );
my $sitetab = xCAT::Table->new('site');
my $vcon = $sitetab->getAttribs({key => "conserveronhmc"}, 'value');
if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
$result = xCAT::PPCcli::lpar_netboot(
$exp,
$request->{verbose},
$name,
$d,
\%opt );
} else {
#########################################
# Manually perform boot.
#########################################
$result = do_rnetboot( $request, $d, $exp, $name, $node, \%opt );
}
$sitetab->close;
$Rc = shift(@$result);
##################################
# Form string from array results

View File

@ -375,10 +375,23 @@ sub getmacs {
if ( !defined( $name )) {
return( [[$node,"Node not found, lparid=$lparid",RC_ERROR]] );
}
#########################################
# Manually collect MAC addresses.
#########################################
$result = do_getmacs( $request, $d, $exp, $name, $node );
my $sitetab = xCAT::Table->new('site');
my $vcon = $sitetab->getAttribs({key => "conserveronhmc"}, 'value');
if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) {
$result = xCAT::PPCcli::lpar_netboot(
$exp,
$request->{verbose},
$name,
$d,
$opt );
} else {
#########################################
# Manually collect MAC addresses.
#########################################
$result = do_getmacs( $request, $d, $exp, $name, $node );
}
$sitetab->close;
$Rc = shift(@$result);
##################################