Commit f8fc27f6 authored by Mike Hibler's avatar Mike Hibler

Add a "slow" power cycle mode to the ops node_reboot script.

It does a "power off; sleep 10; power on". Needed for nodes that need to
settle a while before powering back on (e.g., Anton's ivy bridge box).
parent ce2b4dbb
#! /usr/bin/env python
#
# Copyright (c) 2004-2012 University of Utah and the Flux Group.
# Copyright (c) 2004-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -3850,6 +3850,7 @@ class node:
return argerror
argstr = ""
doslow = 0
for opt, val in argdict.items():
if opt == "wait":
if xbool(val):
......@@ -3861,6 +3862,11 @@ class node:
argstr += " -f "
pass
pass
elif opt == "slow":
if xbool(val):
doslow = 1
pass
pass
elif opt == "reconfig":
if xbool(val):
argstr += " -c "
......@@ -3876,10 +3882,21 @@ class node:
#pass
pass
(exitval, output) = runcommand(TBDIR + "/bin/node_reboot " + argstr)
output += argstr
if exitval:
return EmulabResponse(RESPONSE_ERROR, exitval >> 8, output=output)
if doslow:
(exitval, output) = runcommand(TBDIR + "/bin/power off " + argstr)
if exitval:
return EmulabResponse(RESPONSE_ERROR, exitval >> 8, output=output)
time.sleep(10)
(exitval, output) = runcommand(TBDIR + "/bin/power on " + argstr)
if exitval:
return EmulabResponse(RESPONSE_ERROR, exitval >> 8, output=output)
pass
else:
(exitval, output) = runcommand(TBDIR + "/bin/node_reboot " + argstr)
output += argstr
if exitval:
return EmulabResponse(RESPONSE_ERROR, exitval >> 8, output=output)
pass
# NB: the actual output makes the XML parsers choke and die.
return EmulabResponse(RESPONSE_SUCCESS, output=output)
......
#! /usr/bin/env python
#
# Copyright (c) 2004-2011 University of Utah and the Flux Group.
# Copyright (c) 2004-2011 , 2013University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -319,7 +319,7 @@ class reboot:
def apply(self):
try:
opts, req_args = getopt.getopt(self.argv, "wcfe:", [ "help" ]);
opts, req_args = getopt.getopt(self.argv, "wcfse:", [ "help" ]);
pass
except getopt.error, e:
print e.args[0]
......@@ -342,6 +342,9 @@ class reboot:
elif opt == "-w":
params["wait"] = "yes";
pass
elif opt == "-s":
params["slow"] = "yes";
pass
elif opt == "-e":
pid,eid = string.split(val, ",")
params["proj"] = pid;
......@@ -373,7 +376,8 @@ class reboot:
print "where:";
print " -w - Wait for nodes is come back up";
print " -c - Reconfigure nodes instead of rebooting";
print " -f - Power cycle nodes (skip reboot!)";
print " -f - Force power cycle of nodes (skip reboot!)";
print " -s - Slow power cycle of nodes (power off; sleep 10; power on)";
print " -e - Reboot all nodes in an experiment";
print " node - Node to reboot (pcXXX)";
wrapperoptions();
......
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