Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Elijah Grubb
emulab-devel
Commits
5f72d9ee
Commit
5f72d9ee
authored
Mar 08, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for a <emulab:skipvlans /> rspec directive.
parent
21eaeb31
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
47 deletions
+87
-47
db/VirtExperiment.pm.in
db/VirtExperiment.pm.in
+3
-2
protogeni/lib/GeniAggregate.pm.in
protogeni/lib/GeniAggregate.pm.in
+49
-45
protogeni/lib/GeniCM.pm.in
protogeni/lib/GeniCM.pm.in
+7
-0
protogeni/lib/GeniXML.pm.in
protogeni/lib/GeniXML.pm.in
+11
-0
sql/database-fill.sql
sql/database-fill.sql
+1
-0
sql/updates/4/629
sql/updates/4/629
+16
-0
No files found.
db/VirtExperiment.pm.in
View file @
5f72d9ee
#
!/usr/bin/perl -wT
#
!/usr/bin/perl -wT
#
#
#
Copyright
(
c
)
2009
-
201
4
,
2016
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2009
-
201
8
University
of
Utah
and
the
Flux
Group
.
#
#
#
{{{
EMULAB
-
LICENSE
#
{{{
EMULAB
-
LICENSE
#
#
...
@@ -140,7 +140,8 @@ my $debug = 0;
...
@@ -140,7 +140,8 @@ my $debug = 0;
"delay_capacity"
=>
1
,
"delay_capacity"
=>
1
,
"dpdb"
=>
1
,
"dpdb"
=>
1
,
"nonfsmounts"
=>
1
,
"nonfsmounts"
=>
1
,
"nfsmounts"
=>
1
);
"nfsmounts"
=>
1
,
"skipvlans"
=>
1
);
#
#
#
Grab
the
virtual
topo
for
an
experiment
.
#
Grab
the
virtual
topo
for
an
experiment
.
...
...
protogeni/lib/GeniAggregate.pm.in
View file @
5f72d9ee
...
@@ -1311,59 +1311,63 @@ sub ActionStart($$;$)
...
@@ -1311,59 +1311,63 @@ sub ActionStart($$;$)
# We want to let snmpit run in parallel with os_setup, like the
# We want to let snmpit run in parallel with os_setup, like the
# classic path does.
# classic path does.
#
#
my $snmpit_child = fork();
my $snmpit_child;
if ($snmpit_child) {
#
if (!$experiment->skipvlans()) {
# Parent just continues on, but will wait later, we cannot
$snmpit_child = fork();
# return to the caller until snmpit is done.
if ($snmpit_child) {
#
#
print STDERR "Forked off snmpit: process $snmpit_child\n";
# Parent just continues on, but will wait later, we cannot
}
# return to the caller until snmpit is done.
else {
#
EventFork();
print STDERR "Forked off snmpit: process $snmpit_child\n";
my $msg;
DebugTimeStamp("snmpit started");
if ($flags & $ACTION_FLAGS_SYNCVLANS) {
if (Lan->CompareVlansWithSwitches2($experiment)) {
$msg .= "CompareVlansWithSwitches2 failed!\n";
goto badsnmpit;
}
system("$SNMPIT -X $pid $eid");
if ($?) {
$msg .= "Failed to synchronize vlans";
goto badsnmpit;
}
}
}
else {
else {
my @diff = ();
EventFork();
my @same = ();
my $msg;
if (Lan->CompareVlansWithSwitches($experiment, \@diff, \@same)) {
DebugTimeStamp("snmpit started");
print STDERR "CompareVlansWithSwitches failed!\n";
if ($flags & $ACTION_FLAGS_SYNCVLANS) {
goto badsnmpit;
if (Lan->CompareVlansWithSwitches2($experiment)) {
}
$msg .= "CompareVlansWithSwitches2 failed!\n";
if (@diff) {
goto badsnmpit;
system("$SNMPIT -f ". join(" ", map("-o $_", @diff)));
}
system("$SNMPIT -X $pid $eid");
if ($?) {
if ($?) {
$msg .= "Failed to
remove obsolete VLANs.
";
$msg .= "Failed to
synchronize vlans
";
goto badsnmpit;
goto badsnmpit;
}
}
}
}
system("$SNMPIT -t $pid $eid");
else {
if ($?) {
my @diff = ();
$msg .= "Failed to setup vlans";
my @same = ();
goto badsnmpit;
if (Lan->CompareVlansWithSwitches($experiment, \@diff,\@same)) {
print STDERR "CompareVlansWithSwitches failed!\n";
goto badsnmpit;
}
if (@diff) {
system("$SNMPIT -f ". join(" ", map("-o $_", @diff)));
if ($?) {
$msg .= "Failed to remove obsolete VLANs.";
goto badsnmpit;
}
}
system("$SNMPIT -t $pid $eid");
if ($?) {
$msg .= "Failed to setup vlans";
goto badsnmpit;
}
}
}
DebugTimeStamp("snmpit finished");
# Avoid END block processing
POSIX::_exit(0);
badsnmpit:
print STDERR "Failed to setup vlans: $msg\n";
# Avoid END block processing
POSIX::_exit(-1);
}
}
DebugTimeStamp("snmpit finished");
# Avoid END block processing
POSIX::_exit(0);
badsnmpit:
print STDERR "Failed to setup vlans: $msg\n";
# Avoid END block processing
POSIX::_exit(-1);
}
}
my @nodes = keys(%nodes);
my @nodes = keys(%nodes);
...
...
protogeni/lib/GeniCM.pm.in
View file @
5f72d9ee
...
@@ -876,6 +876,13 @@ sub GetTicketAuxAux($)
...
@@ -876,6 +876,13 @@ sub GetTicketAuxAux($)
#
#
my $disablerootkeys = GeniXML::DisableRootKey($rspec);
my $disablerootkeys = GeniXML::DisableRootKey($rspec);
#
# Allow caller to turn off vlan creation.
#
if (GeniXML::SkipVlans($rspec)) {
$virtexperiment->skipvlans(1);
}
#
#
# User can turn off routing.
# User can turn off routing.
#
#
...
...
protogeni/lib/GeniXML.pm.in
View file @
5f72d9ee
...
@@ -791,6 +791,17 @@ sub DisableRootKey($)
...
@@ -791,6 +791,17 @@ sub DisableRootKey($)
return 1;
return 1;
}
}
sub SkipVlans($)
{
my ($rspec) = @_;
my $tmp = GeniXML::FindNodesNS("n:skipvlans", $rspec, $EMULAB_NS)->pop();
return 1
if (defined($tmp));
return 0;
}
sub GetTarball($)
sub GetTarball($)
{
{
my ($node) = @_;
my ($node) = @_;
...
...
sql/database-fill.sql
View file @
5f72d9ee
...
@@ -992,6 +992,7 @@ REPLACE INTO table_regex VALUES ('experiments','ipassign_args','text','regex','^
...
@@ -992,6 +992,7 @@ REPLACE INTO table_regex VALUES ('experiments','ipassign_args','text','regex','^
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'expt_name'
,
'text'
,
'redirect'
,
'default:fulltext'
,
1
,
255
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'expt_name'
,
'text'
,
'redirect'
,
'default:fulltext'
,
1
,
255
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'dpdb'
,
'int'
,
'redirect'
,
'default:tinyint'
,
0
,
1
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'dpdb'
,
'int'
,
'redirect'
,
'default:tinyint'
,
0
,
1
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'nonfsmounts'
,
'int'
,
'redirect'
,
'default:tinyint'
,
0
,
1
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'nonfsmounts'
,
'int'
,
'redirect'
,
'default:tinyint'
,
0
,
1
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'skipvlans'
,
'int'
,
'redirect'
,
'default:tinyint'
,
0
,
1
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'nfsmounts'
,
'text'
,
'regex'
,
'^(emulabdefault|genidefault|all|none)$'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'nfsmounts'
,
'text'
,
'regex'
,
'^(emulabdefault|genidefault|all|none)$'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'packing_strategy'
,
'text'
,
'regex'
,
'^(pack|balance)$'
,
0
,
0
,
NULL
);
REPLACE
INTO
table_regex
VALUES
(
'experiments'
,
'packing_strategy'
,
'text'
,
'regex'
,
'^(pack|balance)$'
,
0
,
0
,
NULL
);
...
...
sql/updates/4/629
0 → 100644
View file @
5f72d9ee
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('experiments','skipvlans','int','redirect',".
"'default:boolean',0,1,NULL)");
return 0;
}
# Local Variables:
# mode:perl
# End:
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