Commit a900769b authored by Russ Fish's avatar Russ Fish

Allow Windows nodes to ask for power cycle when reboot is wedged.

parent b357f3c0
......@@ -820,6 +820,10 @@ sub stateTransition($$) {
objname => $node);
next;
};
(/^$TBPOWERCYCLE$/) && do {
handleCommand($node,$TBPOWERCYCLE);
next;
};
notify("Unknown trigger '$trig' for $node in $mode/$newstate!\n");
}
# Clear any of the node triggers that we ran.
......
......@@ -458,6 +458,7 @@ REPLACE INTO state_transitions VALUES ('NODEALLOC','RELOAD_PENDING','RELOAD_TO_F
REPLACE INTO state_transitions VALUES ('PXEKERNEL','PXEWAKEUP','PXEWAKEUP','Retry');
REPLACE INTO state_transitions VALUES ('NORMALv2','ISUP','SHUTDOWN','Reboot');
REPLACE INTO state_transitions VALUES ('NORMALv2','BOOTING','SHUTDOWN','Error');
REPLACE INTO state_transitions VALUES ('NORMALv2','SHUTDOWN','WEDGED','Error');
REPLACE INTO state_transitions VALUES ('NORMALv2','BOOTING','TBSETUP','BootOK');
REPLACE INTO state_transitions VALUES ('NORMALv2','PXEBOOTING','BOOTING','BootInfo');
REPLACE INTO state_transitions VALUES ('NORMALv2','ISUP','PXEBOOTING','KernelChange');
......@@ -517,6 +518,7 @@ REPLACE INTO state_triggers VALUES ('*','*','BOOTING','BOOTING, CHECKGENISUP');
REPLACE INTO state_triggers VALUES ('*','MINIMAL','ISUP','RESET');
REPLACE INTO state_triggers VALUES ('*','RELOAD-MOTE','RELOADDONE','RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','OPSNODEBSD','ISUP','SCRIPT:opsreboot');
REPLACE INTO state_triggers VALUES ('*','NORMALv2','WEDGED','POWERCYCLE');
--
-- Dumping data for table `table_regex`
......
......@@ -65,6 +65,12 @@ for ifc in `regtool list $nbtif`; do
regtool set -i $nbtif/$ifc/DisableDynamicUpdate 1
done
# Turn off LMHOSTS lookup to make sure NetBT is not active.
# Sometimes we get errors like this trying to reboot below:
# Error 53 The network path was not found.
nbtp=$svcs/NetBT/Parameters
regtool set -i $nbtp/EnableLMHOSTS 0
# Turn on IP forwarding if there is more than one experimental net interface.
# Also requires a reboot to take effect.
tp=$svcs/Tcpip/Parameters
......@@ -81,6 +87,8 @@ if [ $nodeid = $hostname ]; then
logit "$host matches nodeid '$nodeid'."
else
logit "$host differs from nodeid '$nodeid'."
# A reboot will be required.
tmcd state SHUTDOWN
logit "Remove a redirect switch to make sure we come back with a serial console."
bootcfg /ems OFF /id 1
......@@ -109,8 +117,12 @@ else
tsshutdn 1 /REBOOT /DELAY:1
sleep 10
# Give up, log it, and go on.
logit "$host - Failed to reboot changing to '$nodeid'."
# Give up, log it, ask for power cycle, and wait until timeout if that fails.
logit "$host - Failed to reboot changing to '$nodeid' Asking for power cycle."
tmcc state WEDGED
sleep 1200
# Should never get here!
logit "$host - Failed power cycle too. Network stack is not reset."
fi
logit "rc.firstboot finished."
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