diff --git a/perl-xCAT/xCAT/FSPcfg.pm b/perl-xCAT/xCAT/FSPcfg.pm index 8c282f39a..75cd7cc30 100644 --- a/perl-xCAT/xCAT/FSPcfg.pm +++ b/perl-xCAT/xCAT/FSPcfg.pm @@ -75,7 +75,9 @@ sub parse_args { "resetnet", "sysname", "pending_power_on_side", - "BSR" + "BSR", + "setup_failover", + "force_failover" ); my @frame = ( "frame", @@ -234,7 +236,8 @@ sub parse_args { $request->{method} = "resetnet"; return( \%opt ); } - if(exists($cmds{sysname}) or exists($cmds{pending_power_on_side}) or exists($cmds{BSR})) { + if(exists($cmds{sysname}) or exists($cmds{pending_power_on_side}) or exists($cmds{BSR}) + or exists($cmds{setup_failover}) or exists($cmds{force_failover})) { $request->{hcp} = $request->{hwtype} eq 'frame' ? "bpa":"fsp"; $request->{method} = "do_fspapi_function"; return (\%opt); @@ -309,7 +312,12 @@ sub parse_option { return ("Invalid pending_power_on_side param '$value'"); } } - if ($command eq 'BSR') { + if ($command eq 'setup_failover') { + if ($value !~ /^(enable|disable)$/) { + return ("Invalid setup_failover param '$value'"); + } + } + if ($command =~ /^(BSR|force_failover)$/ ) { return ("BSR value can not be set"); } return undef; @@ -353,6 +361,19 @@ my %fspapi_action = ( query => { cec => "get_cec_bsr" } + }, + setup_failover => { + query => { + cec => "cec_setup_failover" + }, + set => { + cec => "cec_setup_failover" + } + }, + force_failover => { + query => { + cec => "cec_force_failover" + } } ); sub do_process_query_res { @@ -381,6 +402,8 @@ sub do_process_query_res { foreach my $v (@values) { push @$result, [$name, $v, '0']; } + } else { + push @$result, $res; } return undef; } @@ -410,6 +433,8 @@ sub do_set_get_para { return (($value eq '*') ? $node_name : $value); } elsif ($cmd =~ /^pending_power_on_side$/){ return ($value =~ /^perm$/) ? '0' : '1'; + } elsif ($cmd =~ /^setup_failover$/) { + return ($value =~ /^enable$/) ? '1' : '0'; } } @@ -453,7 +478,7 @@ sub do_fspapi_function { my @ret = (); my $res; my $args = $request->{arg}; - my @fspapi_array = qw/sysname pending_power_on_side BSR/; + my @fspapi_array = qw/sysname pending_power_on_side BSR setup_failover force_failover/; my $invalid_node = &check_node_info($hash); if (defined($invalid_node)) { return ([[$invalid_node, "Node must be CEC or Frame", '1']]); diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index d34807438..627ec12bc 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -142,6 +142,9 @@ my %usage = ( rspconfig [cec_off_policy] rspconfig [cec_off_policy=] rspconfig [BSR] + rspconfig [setup_failover] + rspconfig [setup_failover=] + rspconfig [force_failover] rspconfig --resetnet BPA/Frame (using Direct FSP Management)specific: rspconfig HMC_passwd= diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 64ea6ea79..6f5915538 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -140,6 +140,12 @@ B I B={B|B} B I {B} +B I {B} + +B I B={B|B} + +B I {B} + B I B<--resetnet> =head2 BPA/Frame (using Direct FSP Management) Specific: @@ -254,6 +260,14 @@ Display the CEC/BPA system names. Get Barrier Synchronization Register (BSR) allocation for a CEC. +=item B={I|I} + +Enable or disable the service processor failover function of a CEC or display status of this function. + +=item B + +Force a service processor failover from the primary service processor to the secondary service processor. + =item B={I<*|name>} Set CEC/BPA system names to the names in xCAT DB or the input name. @@ -615,6 +629,46 @@ B I =item * +To disable service processor failover for cec01, in order to complete this command, the user should power off cec01 first: + +B I + + cec01: Failover status: Enabled + +B I + +B I + + cec01: Success + +B I + + cec01: Failover status: Disabled + +=item * + +To force service processor failover for cec01: + +B I + + cec01: 192.168.1.1: LINE DOWN + cec01: 192.168.2.1: sp=primary,ipadd=192.168.2.1,alt_ipadd=unavailable,state=LINE UP + cec01: 192.168.1.2: sp=secondary,ipadd=192.168.1.2,alt_ipadd=unavailable,state=LINE UP + cec01: 192.168.2.2: LINE DOWN + +B I + + cec01: Success. + +B I + + cec01: 192.168.1.1: sp=secondary,ipadd=192.168.1.1,alt_ipadd=unavailable,state=LINE UP + cec01: 192.168.2.1: LINE DOWN + cec01: 192.168.1.2: LINE DOWN + cec01: 192.168.2.2: sp=primary,ipadd=192.168.2.2,alt_ipadd=unavailable,state=LINE UP + +=item * + To deconfigure memory bank 9 and 10 of Processing Unit 0 on mm01: B I