1. rflash with --ommit and --recover for BPA, bug2611785 2. noderange' format --bug 2684634

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2877 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2009-03-12 07:28:21 +00:00
parent d93ed443ed
commit 2ca309fb17
4 changed files with 36 additions and 24 deletions

View File

@ -444,7 +444,15 @@ sub preprocess_nodes {
if(@$d[4] =~/^(fsp|lpar)$/) {
$f1 = 1;
} else {
$f2 = 1;
$f2 = 1;
my $exargs=$request->{arg};
my $t= xCAT::PPCrflash::print_var($exargs, "exargs");
if ( grep(/commit/,@$exargs) != 0 || grep(/recover/,@$exargs) != 0) {
send_msg( $request, 1, "When run \"rflash\" with the \"commit\" or \"recover\" operation, the noderange cannot be BPA and can only be CEC or LPAR.");
send_msg( $request, 1, "And then, it will do the operation for both managed systems and power subsystems.");
return undef;
}
}
}

View File

@ -307,28 +307,32 @@ sub get_lic_filenames {
sub get_one_mtms {
my $bpa = shift;
my $tab = xCAT::Table->new("ppc");
my $msg ;
unless ($tab) {
$msg = "ERROR: Unable to open basic ppc table for configuration";
return ("", $msg);
}
my $exp = shift;
my $bpa = shift;
my $cmd = "lssyscfg -r cage -e $bpa";
my $mtms;
my $msg;
my $values = xCAT::PPCcli::send_cmd( $exp, $cmd );
my $Rc = shift(@$values);
#####################################
# Return error
#####################################
if ( $Rc != SUCCESS ) {
$msg = "ERROR: Failed to find a CEC managed by $bpa on the HMC";
return ("", $msg);
}
foreach (@$values) {
if( $_ =~ /cage_num=(\w*),contents=sys,type_model_serial_num=(\w+)-(\w+)\*(\w+),loc_code=(\w+).(\w+).(\w+)/) {
$mtms = "$2-$3*$4";
last;
}
}
#################################
# Get node
#################################
my @ent = $tab->getAllAttribsWhere("parent=\"$bpa\"", 'node');
if (@ent < 0) {
$msg = "failed to get the CEC whose parent is $bpa!";
return ("", $msg);
}
my $cec = $ent[0]->{node};
$msg = "the first cec is $cec whose parent is $bpa!";
$cec =~ /(\w{6})\-([\w\-]{8})\-SN(\w{7})/;
my $mtms = "$2*$3";
# print "the managed system is $mtms!\n";
# print "the managed system is $mtms!\n";
return ($mtms, $msg);
}
@ -468,7 +472,7 @@ sub rflash {
#If mtms is a bpa, we should change the managed_system to a cec whose parent is a bpa.
if($component eq "power") {
($managed_system, $msg)= &get_one_mtms($name);
($managed_system, $msg)= &get_one_mtms($exp, $managed_system);
if($managed_system eq "") {
push(@value, [$hmc, $msg]);
return (\@value);

View File

@ -30,7 +30,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f
The B<--commit> flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The B<--recover> flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored.
B<NOTE:>At present, the B<rflash> command B<doesn't> support B<commit/recover> for BPAs. Because the command "B<licutil>" on HMC doesn't support the "B<commit>" and "B<recover>" operation for the BPA. And "B<rflash>" is dependent on the "B<licutil>" command. So when the B<--commit> or B<--recover> two flags is used, the noderange cannot be a BPA or BPA list in the B<rflash> command. xCAT will pay the attention to the changes all the time.
B<NOTE:>When the B<--commit> or B<--recover> two flags is used, the noderange B<cannot> be BPA. It only B<can> be CEC or LPAR ,and will take effect for B<both> managed systems and power subsystems.
xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems.
@ -96,7 +96,7 @@ B<rflash> I<bpa_name> I<-p /tmp/fw> I<--activate disruptive>
=item 3
To commit a firmware update to permanent flash on an HMC-attached CEC, enter:
To commit a firmware update to permanent flash for both managed system and the related power subsystems, enter:
B<rflash> I<cec_name> I<--commit>