Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
970cc63b
Commit
970cc63b
authored
Jul 31, 2001
by
Christopher Alfeld
Browse files
Added tb-set-node-failure-action support.
parent
63229185
Changes
3
Show whitespace changes
Inline
Side-by-side
tbsetup/assign_wrapper.in
View file @
970cc63b
...
...
@@ -929,12 +929,13 @@ foreach $pnode (keys(%p2vmap)) {
foreach
$pair
(
@nodepairs
)
{
(
$pnode
,
$vnode
)
=
@$pair
;
$sth
=
$dbh
->
prepare
("
SELECT osid,cmd_line,rpms,deltas,startupcmd,
"
.
"
tarfiles from virt_nodes where pid=
\"
$pid
\"
"
.
"
tarfiles,failureaction from virt_nodes
"
.
"
where pid=
\"
$pid
\"
"
.
"
and eid=
\"
$eid
\"
and vname=
\"
$vnode
\"
");
$sth
->
execute
;
# The if statement will cause us to skip nodes that belong to
# the experiment but aren't virtual. I.e. delay nodes.
if
((
$osid
,
$cmdline
,
$rpms
,
$deltas
,
$startupcmd
,
$tarfiles
)
=
if
((
$osid
,
$cmdline
,
$rpms
,
$deltas
,
$startupcmd
,
$tarfiles
,
$failureaction
)
=
$sth
->
fetchrow_array
)
{
if
(
!
$dbh
->
do
("
UPDATE nodes set def_boot_osid=
\"
$osid
\"
,
"
.
"
def_boot_cmd_line=
\"
$cmdline
\"
,
"
.
...
...
@@ -944,7 +945,8 @@ foreach $pair (@nodepairs) {
"
rpms=
\"
$rpms
\"
,
"
.
"
deltas=
\"
$deltas
\"
,
"
.
"
tarballs=
\"
$tarfiles
\"
,
"
.
"
startupcmd=
\"
$startupcmd
\"
"
.
"
startupcmd=
\"
$startupcmd
\"
,
"
.
"
failureaction=
\"
$failureaction
\"
"
.
"
where node_id=
\"
$pnode
\"
"))
{
print
STDERR
"
$0: *** Could not update nodes table.
"
.
"
Giving up.
\n
";
...
...
tbsetup/ns2ir/node.tcl
View file @
970cc63b
...
...
@@ -40,6 +40,7 @@ Node instproc init {s} {
$self set startup
""
$self set deltas
""
$self set tarfiles
""
$self set failureaction
"fatal"
}
# The following procs support renaming
(
see README
)
...
...
@@ -76,6 +77,7 @@ Node instproc updatedb {DB} {
$self instvar deltas
$self instvar iplist
$self instvar tarfiles
$self instvar failureaction
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
...
...
@@ -96,7 +98,7 @@ Node instproc updatedb {DB} {
}
# Update the DB
sql exec $DB
"insert into virt_nodes (pid,eid,vname,type,ips,osid,cmd_line,rpms,deltas,startupcmd,tarfiles) values (
\"
$pid
\"
,
\"
$eid
\"
,
\"
$self
\"
,
\"
$type
\"
,
\"
$ipraw
\"
,
\"
$osid
\"
,
\"
$cmdline
\"
,
\"
$rpms
\"
,
\"
$deltas
\"
,
\"
$startup
\"
,
\"
$tarfiles
\"
)"
;
sql exec $DB
"insert into virt_nodes (pid,eid,vname,type,ips,osid,cmd_line,rpms,deltas,startupcmd,tarfiles
,failureaction
) values (
\"
$pid
\"
,
\"
$eid
\"
,
\"
$self
\"
,
\"
$type
\"
,
\"
$ipraw
\"
,
\"
$osid
\"
,
\"
$cmdline
\"
,
\"
$rpms
\"
,
\"
$deltas
\"
,
\"
$startup
\"
,
\"
$tarfiles
\"
,
\"
$failureaction
\"
)"
;
}
# add_lanlink lanlink
...
...
tbsetup/ns2ir/tb_compat.tcl.in
View file @
970cc63b
...
...
@@ -252,3 +252,15 @@ proc tb-set-node-lan-params {node lan delay bw loss} {
tb-set-node-lan-bandwidth $node $lan $bw
tb-set-node-lan-loss $node $lan $loss
}
proc tb-set-node-failure-action {node type} {
if {[$node info class] != "Node"} {
perror "\[tb-set-node-failure-action] $node is not a node."
return
}
if {[lsearch -exact {fatal nonfatal ignore} $type] == -1} {
perror "\[tb-set-node-failure-action] type must be one of fatal|nonfatal|ignore."
return
}
$node set failureaction $type
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment