From deb834218b3c33ec843ad6529726e516ea48f574 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 27 May 2009 07:52:18 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/PPCboot.pm | 22 ++++++++++++++++++---- perl-xCAT/xCAT/PPCmac.pm | 21 +++++++++++++++++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/perl-xCAT/xCAT/PPCboot.pm b/perl-xCAT/xCAT/PPCboot.pm index 4281d97ed..f8f1ae9a7 100644 --- a/perl-xCAT/xCAT/PPCboot.pm +++ b/perl-xCAT/xCAT/PPCboot.pm @@ -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 diff --git a/perl-xCAT/xCAT/PPCmac.pm b/perl-xCAT/xCAT/PPCmac.pm index 968d80648..f59ec0927 100644 --- a/perl-xCAT/xCAT/PPCmac.pm +++ b/perl-xCAT/xCAT/PPCmac.pm @@ -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); ##################################