Commit 84542085 authored by Leigh Stoller's avatar Leigh Stoller

Add new stated to RELOAD machine. RELOADDONEV2 is now sent from the

frisbee MFS, and stated will send an apod out to it. This updates the
previous revision in which I was doing this for RELOADDONE state, so
that we maintain backwards compatability with older frisbee MFSs.
parent 5508d17e
......@@ -92,7 +92,8 @@ use vars qw(@ISA @EXPORT);
TBDB_NODESTATE_ISUP TBDB_NODESTATE_REBOOTING TBDB_NODESTATE_REBOOTED
TBDB_NODESTATE_SHUTDOWN TBDB_NODESTATE_BOOTING TBDB_NODESTATE_TBSETUP
TBDB_NODESTATE_RELOADSETUP TBDB_NODESTATE_RELOADING
TBDB_NODESTATE_RELOADDONE TBDB_NODESTATE_UNKNOWN
TBDB_NODESTATE_RELOADDONE TBDB_NODESTATE_RELOADDONE_V2
TBDB_NODESTATE_UNKNOWN
TBDB_NODESTATE_PXEWAIT TBDB_NODESTATE_PXEWAKEUP
TBDB_NODESTATE_PXEBOOTING TBDB_NODESTATE_ALWAYSUP
TBDB_NODESTATE_MFSSETUP TBDB_NODESTATE_TBFAILED
......@@ -141,6 +142,7 @@ use vars qw(@ISA @EXPORT);
TB_OSID_FREEBSD_MFS TB_OSID_FRISBEE_MFS
TBBootWhat TBNodeStateTimeout
TBDB_TBCONTROL_RESET TBDB_TBCONTROL_RELOADDONE
TBDB_TBCONTROL_RELOADDONE_V2
TBDB_TBCONTROL_TIMEOUT TBDB_NO_STATE_TIMEOUT
TBDB_TBCONTROL_PXEBOOT TBDB_TBCONTROL_BOOTING
TBDB_TBCONTROL_CHECKGENISUP
......@@ -521,6 +523,7 @@ sub TBDB_NODESTATE_MFSSETUP() { "MFSSETUP"; }
sub TBDB_NODESTATE_TBFAILED() { "TBFAILED"; }
sub TBDB_NODESTATE_RELOADING() { "RELOADING"; }
sub TBDB_NODESTATE_RELOADDONE() { "RELOADDONE"; }
sub TBDB_NODESTATE_RELOADDONE_V2(){ "RELOADDONEV2"; }
sub TBDB_NODESTATE_UNKNOWN() { "UNKNOWN"; };
sub TBDB_NODESTATE_PXEWAIT() { "PXEWAIT"; }
sub TBDB_NODESTATE_PXEWAKEUP() { "PXEWAKEUP"; }
......@@ -567,6 +570,7 @@ sub TBDB_ALLOCSTATE_UNKNOWN() { "UNKNOWN"; };
sub TBDB_TBCONTROL_RESET { "RESET"; }
sub TBDB_TBCONTROL_RELOADDONE { "RELOADDONE"; }
sub TBDB_TBCONTROL_RELOADDONE_V2{ "RELOADDONEV2"; }
sub TBDB_TBCONTROL_TIMEOUT { "TIMEOUT"; }
sub TBDB_TBCONTROL_PXEBOOT { "PXEBOOT"; }
sub TBDB_TBCONTROL_BOOTING { "BOOTING"; }
......
......@@ -127,7 +127,6 @@ if ($opt{d}) {
# Grab some constants into variables
my $TBANYMODE = TBDB_NODEOPMODE_ANY;
my $TBRESET = TBDB_TBCONTROL_RESET;
my $TBRELOADDONE = TBDB_TBCONTROL_RELOADDONE;
my $TBTIMEOUT = TBDB_TBCONTROL_TIMEOUT;
my $PXEBOOT = TBDB_TBCONTROL_PXEBOOT;
my $BOOTING = TBDB_TBCONTROL_BOOTING;
......@@ -145,6 +144,8 @@ my $TBISUP = TBDB_NODESTATE_ISUP;
my $PXEWAIT = TBDB_NODESTATE_PXEWAIT;
my $PXEWAKEUP = TBDB_NODESTATE_PXEWAKEUP;
my $PXEBOOTING = TBDB_NODESTATE_PXEBOOTING;
my $TBRELOADDONEV1 = TBDB_TBCONTROL_RELOADDONE;
my $TBRELOADDONEV2 = TBDB_TBCONTROL_RELOADDONE_V2;
my $TBTIMEOUTREBOOT = TBDB_STATED_TIMEOUT_REBOOT;
my $TBTIMEOUTNOTIFY = TBDB_STATED_TIMEOUT_NOTIFY;
my $TBTIMEOUTCMDRETRY = TBDB_STATED_TIMEOUT_CMDRETRY;
......@@ -807,7 +808,7 @@ sub stateTransition($$) {
}
next;
};
/^$TBRELOADDONE$/ && do {
(/^$TBRELOADDONEV1$/ || /^$TBRELOADDONEV2$/) && do {
handleCtrlEvent($node,$trig);
next;
};
......@@ -917,7 +918,7 @@ sub handleCtrlEvent($$) {
info("Performed $TBRESET for $node\n");
next;
};
/^$TBRELOADDONE$/ && do {
(/^$TBRELOADDONEV1$/ || /^$TBRELOADDONEV2$/) && do {
info("Clearing reload info for $node\n");
DBQueryFatal("delete from current_reloads where node_id='$node'");
my ($pid,$eid);
......@@ -930,9 +931,11 @@ sub handleCtrlEvent($$) {
$UID, $pid, $eid);
info("Released $node from $pid/$eid\n");
}
info("Sending an apod to $node\n");
system("$apod $node") == 0 or
notify("Could not apod $node after $TBRELOADDONE!\n");
if ($event eq $TBRELOADDONEV2) {
info("Sending an apod to $node\n");
system("$apod $node") == 0 or
notify("Could not apod $node after $TBRELOADDONEV2!\n");
}
next;
};
/^$TBTIMEOUT$/ && do {
......
......@@ -73,6 +73,7 @@ char *tbdb_eventtypes[] = {
TBDB_NODESTATE_RELOADSETUP,
TBDB_NODESTATE_RELOADING,
TBDB_NODESTATE_RELOADDONE,
TBDB_NODESTATE_RELOADDONE_V2,
TBDB_NODESTATE_UNKNOWN,
TBDB_NODEOPMODE_NORMAL,
TBDB_NODEOPMODE_DELAYING,
......@@ -86,6 +87,7 @@ char *tbdb_eventtypes[] = {
TBDB_NODEOPMODE_UNKNOWN,
TBDB_TBCONTROL_RESET,
TBDB_TBCONTROL_RELOADDONE,
TBDB_TBCONTROL_RELOADDONE_V2,
TBDB_TBCONTROL_TIMEOUT,
0,
};
......
......@@ -84,6 +84,7 @@
#define TBDB_NODESTATE_RELOADSETUP "RELOADSETUP"
#define TBDB_NODESTATE_RELOADING "RELOADING"
#define TBDB_NODESTATE_RELOADDONE "RELOADDONE"
#define TBDB_NODESTATE_RELOADDONE_V2 "RELOADDONEV2"
#define TBDB_NODESTATE_UNKNOWN "UNKNOWN"
#define TBDB_NODESTATE_PXEWAIT "PXEWAIT"
#define TBDB_NODESTATE_PXEWAKEUP "PXEWAKEUP"
......@@ -102,6 +103,7 @@
#define TBDB_TBCONTROL_RESET "RESET"
#define TBDB_TBCONTROL_RELOADDONE "RELOADDONE"
#define TBDB_TBCONTROL_RELOADDONE_V2 "RELOADDONEV2"
#define TBDB_TBCONTROL_TIMEOUT "TIMEOUT"
#define TBDB_IFACEROLE_CONTROL "ctrl"
......
......@@ -215,9 +215,12 @@ REPLACE INTO mode_transitions VALUES ('NORMALv1','SHUTDOWN','NETBOOT','SHUTDOWN'
REPLACE INTO mode_transitions VALUES ('NORMALv1','SHUTDOWN','NORMAL','REBOOTING','');
REPLACE INTO mode_transitions VALUES ('NORMALv1','SHUTDOWN','RELOAD','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONE','MINIMAL','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONEV2','MINIMAL','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONE','NETBOOT','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONE','NORMAL','REBOOTING','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONEV2','NORMAL','REBOOTING','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONE','NORMALv1','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONEV2','NORMALv1','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','SHUTDOWN','MINIMAL','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','SHUTDOWN','NETBOOT','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','SHUTDOWN','NORMAL','REBOOTING','');
......@@ -237,6 +240,7 @@ REPLACE INTO mode_transitions VALUES ('NORMALv2','SHUTDOWN','NETBOOT','SHUTDOWN'
REPLACE INTO mode_transitions VALUES ('NORMALv2','SHUTDOWN','RELOAD','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','SHUTDOWN','PXEFBSD','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONE','NORMALv2','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','RELOADDONEV2','NORMALv2','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('NORMALv2','SHUTDOWN','PXEFBSD','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('RELOAD','SHUTDOWN','NORMALv2','SHUTDOWN','');
REPLACE INTO mode_transitions VALUES ('NORMALv1','SHUTDOWN','PXEFBSD','SHUTDOWN','');
......@@ -261,6 +265,7 @@ REPLACE INTO state_timeouts VALUES ('NORMAL','REBOOTED',60,'NOTIFY');
REPLACE INTO state_timeouts VALUES ('MINIMAL','SHUTDOWN',120,'REBOOT');
REPLACE INTO state_timeouts VALUES ('NORMALv1','TBSETUP',600,'NOTIFY');
REPLACE INTO state_timeouts VALUES ('RELOAD','RELOADDONE',60,'NOTIFY');
REPLACE INTO state_timeouts VALUES ('RELOAD','RELOADDONEV2',60,'NOTIFY');
REPLACE INTO state_timeouts VALUES ('EXPTSTATUS','ACTIVATING',0,'');
REPLACE INTO state_timeouts VALUES ('EXPTSTATUS','ACTIVE',0,'');
REPLACE INTO state_timeouts VALUES ('EXPTSTATUS','NEW',0,'');
......@@ -338,6 +343,7 @@ REPLACE INTO state_transitions VALUES ('RELOAD','BOOTING','BOOTING','DHCPRetry')
REPLACE INTO state_transitions VALUES ('RELOAD','BOOTING','RELOADSETUP','BootOK');
REPLACE INTO state_transitions VALUES ('RELOAD','BOOTING','SHUTDOWN','Error');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADING','RELOADDONE','ReloadDone');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADING','RELOADDONEV2','ReloadDone');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADING','SHUTDOWN','Error');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADSETUP','RELOADING','ReloadReady');
REPLACE INTO state_transitions VALUES ('RELOAD','RELOADSETUP','SHUTDOWN','Error');
......@@ -488,6 +494,7 @@ REPLACE INTO state_transitions VALUES ('GARCIA-STARGATEv1','TBFAILED','SHUTDOWN'
REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADDONE','RESET, RELOADDONE');
REPLACE INTO state_triggers VALUES ('*','RELOAD','RELOADDONEV2','RESET, RELOADDONEV2');
REPLACE INTO state_triggers VALUES ('*','ALWAYSUP','SHUTDOWN','ISUP');
REPLACE INTO state_triggers VALUES ('*','*','ISUP','RESET');
REPLACE INTO state_triggers VALUES ('*','*','PXEBOOTING','PXEBOOT');
......
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