Commit 57c56278 authored by Leigh Stoller's avatar Leigh Stoller

ilo3 does not want newlines sent to it during the expect sequence.

Appears to be a known problem (well, feature). So, I added ilo3 as a
type and use that to send the proper termination (formfeed).
parent 6db144c6
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -342,7 +342,7 @@ foreach my $power_id (keys %outlets) {
if ($power_id eq "mail" || $power_id =~ /^whol-/
|| $power_id=~ /^rmcp-/
|| $power_id eq 'drac'
|| $power_id eq 'ilo' || $power_id eq 'ilo2') {
|| $power_id eq 'ilo' || $power_id eq 'ilo2' || $power_id eq 'ilo3') {
$type = $power_id;
$IP = "";
$class = "";
......@@ -434,7 +434,8 @@ foreach my $power_id (keys %outlets) {
print "Control of $nodestr failed.\n"; ++$exitval;
++$errors;
}
} elsif ($type eq 'ilo2' || $type eq 'ilo' || $type eq 'drac') {
} elsif ($type eq 'ilo3' || $type eq 'ilo2' || $type eq 'ilo' ||
$type eq 'drac') {
if (iloctrl($type,$op,@nodes)) {
print "Control of $nodestr failed.\n"; ++$exitval;
++$errors;
......
......@@ -7,10 +7,10 @@
#
#
# Handle iLO or iLO 2 remote power control.
# Handle iLO[23] remote power control.
# Also handle DRAC since its so similar.
# Node must have an interface such that role='mngmnt' and
# interface_type='ilo2' or 'ilo'.
# interface_type='ilo[23]'.
#
# Supports either pubkey or passwd auth, depending on what's in db.
#
......@@ -41,7 +41,7 @@ my %portinfo = ();
#
# usage: iloctrl(type, cmd, nodes)
# type = { "ilo" | "ilo2" }
# type = { "ilo" | "ilo2" | "ilo3" }
# cmd = { "cycle" | "on" | "off" }
# nodes = list of one or more physical node names
#
......@@ -171,7 +171,8 @@ sub iloexec($$$$$$$;$) {
return -11;
}
if ($type ne 'ilo' && $type ne 'ilo2' && $type ne "drac") {
if ($type ne 'ilo' && $type ne 'ilo2' && $type ne 'ilo3' &&
$type ne "drac") {
warn "Unsupported iLO/DRAC type $type!";
return -7;
}
......@@ -300,7 +301,8 @@ sub iloexec($$$$$$$;$) {
}
if ($line =~ /$rval$/) {
print $pty "$sval\r\n";
print $pty $sval;
print $pty ($type eq "ilo3" ? "\r" : "\r\n");
if ($debug) {
print "sent '$sval'\n";
}
......
......@@ -13,7 +13,7 @@ use Data::Dumper;
use File::Temp qw(tempfile);
#
# Add a management interface for a node. ilo, ilo2, drac.
# Add a management interface for a node. ilo, ilo2, ilo3, drac.
# When adding for a local node, try to insert switch info if -s is given.
# Also restart DHCPD since we now add entries for local management interfaces.
#
......@@ -23,7 +23,7 @@ sub usage()
print STDERR " [-s <switchinfo>] <node_id> mac IP arg1 arg2\n";
print STDERR " management_iface -r <node_id>\n";
print STDERR " -h This message\n";
print STDERR " -t type Management type; ilo, ilo2, drac\n";
print STDERR " -t type Management type; ilo, ilo2, ilo3, drac\n";
print STDERR " -s info Optional switch info; switch,card,port\n";
print STDERR " -s - Search output of switchmac to find switch info\n";
print STDERR " -a pswd Password auth; provide login and password.\n";
......@@ -95,7 +95,8 @@ if (defined($options{'s'})) {
if (defined($options{'t'})) {
$type = $options{'t'};
usage()
if (! ($type eq "ilo" || $type eq "ilo2" || $type eq "drac"));
if (! ($type eq "ilo" || $type eq "ilo2" || $type eq "ilo3" ||
$type eq "drac"));
}
if (defined($options{'a'})) {
$authtype = $options{'a'};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment