[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 10/26] 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 <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d1b7ad66..5e2fb488 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 ($$$) {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.