From: Ian Jackson Date: Tue, 22 Jan 2019 15:50:00 +0000 (+0000) Subject: power: New ILOM/PDU arrangements - try just IPMI X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b0ba0f5f296681f671fdc4982c7d44fb9b14748c;p=osstest.git power: New ILOM/PDU arrangements - try just IPMI We honour two new host properties PowerPDU and PowerILOM, in preference to PowerMethod. The semantics are going to be properly documented in a later patch, but, briefly: If only one of these is supplied, it works like PowerMethod, except that `nest' is applied by default. If both are supplied, we make two approaches: one is just ILOM. The other is to use ILOM and PDU together, with pause in between, and with try_off applied to ILOM. The current configuration in Massachusetts is, for hosts with IPMI, to provide a PowerMethod specifying ad hoc to use PDU and then IPMI, and also to provide both PowerPDU and PowerILOM. The overall result of this patch, with that configuration, is to avoid using the PDU at all if an IPMI-requested reboot is successful. This should significantly reduce the number of hard power cycles for hosts with IMPI. Signed-off-by: Ian Jackson --- diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index d1b7ad6..5e2fb48 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -935,15 +935,47 @@ sub power_cycle_parse_method ($$) { sub power_cycle_host_setup ($) { my ($ho) = @_; - my $spec = ($ho->{Power} // 'unsupported'); # $ho->{PowerApproaches}[]{Name} see below # $ho->{PowerApproaches}[]{MethObjs}[] each has ->pdu_power_state($on) # `Name's are: # Only Host only supports one method and this is it - $ho->{PowerApproaches} = { - Name => 'Only', - MethObjs => power_cycle_parse_method($ho, $spec), - }; + # ILOM Try to use just the ILOM + # PDU Try to use the PDU (but also turn off/on ILOM if provided) + my @approaches; + my $pdu_s = get_host_property($ho,'PowerPDU'); + my $ilom_s = get_host_property($ho,'PowerILOM'); + if ($pdu_s || $ilom_s) { + my $ilom_m; + if ($ilom_s) { + $ilom_m = power_cycle_parse_method($ho, $ilom_s); + push @approaches, { + Name => 'ILOM', + MethObjs => ['nest', @$ilom_m ], + }; + } + if ($pdu_s) { + my $pdu_m = power_cycle_parse_method($ho, $pdu_s); + if ($ilom_m) { + require Osstest::PDU::try_off; + $pdu_m = [ + @$pdu_m, + get_host_method_object($ho, 'PDU', 'pause'), + map { Osstest::PDU::try_off->new_from_mo($_) } @$ilom_m, + ]; + } + push @approaches, { + Name => 'PDU', + MethObjs => ['nest', @$pdu_m ], + }; + } + } else { + my $spec = ($ho->{Power} // 'unsupported'); + push @approaches, { + Name => 'Only', + MethObjs => power_cycle_parse_method($ho, $spec), + }; + } + $ho->{PowerApproaches} = \@approaches; } sub power_reboot_attempts ($$$) {