Commit c75d265f authored by Kevin Atkinson's avatar Kevin Atkinson

Modified cloudinfo to dump output in the form cloudinfo-set can use.

Fixed bugs in cloudinfo-set

Added documention (well, relevent email messages) on cloudinfo and
cloudinfo-set.
parent ab421753
......@@ -2,7 +2,7 @@
#
# cloudinfo-set: Set the cloud info based on an input file of the form:
#
#
# <pid> <eid>
# <src> <dst> <bw> <delay> <loss>
#
......@@ -17,13 +17,23 @@ chop;
my ($pid,$eid) = /^(\S+)\s+(\S+)$/ or die
"First line must be of the form \"<pid> <eid>\"\n";
my $failures = 0;
while (<>) {
my ($src, $dst, $bw, $del, $plr) = split /\s+/;
my $dstix = $dst =~ (/^elab-\d+$/) or die "Host names must be of the form elab-NUM\n";
my $dstip = "10.0.0.$dstix";
my $dstip = $dst;
if ($dstip !~ /^\d+\.\d+\.\d+\.\d+$/) {
$dst =~ (/^elab-(\d+)$/) or die "Host names must be of the form elab-NUM\n";
$dstip = "10.0.0.$1";
}
my $cmd = "$TEVC -e $pid/$eid now elabc-$src MODIFY ".
"DEST=$dstip BANDWIDTH=$bw DELAY=$del PLR=$plr";
print STDERR "$cmd\n";
system("$cmd");
if ($? != 0) {
print STDERR "*** Failed to set paramters for $src -> $dst\n";
$failures++;
}
}
exit $failures;
......@@ -5,9 +5,12 @@
# Only used with pelab "clouds" right now (hence the name).
#
use Getopt::Std;
my $verbose = 1;
my $ispelab = 1;
my $zeroem = 0;
my $dumpfile = 0;
use constant IN_SHOW => 1;
use constant IN_SHOWP => 2;
......@@ -23,17 +26,20 @@ q(^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+));
sub usage()
{
print STDERR "usage: cloudinfo [-z] pid eid\n";
print STDERR "usage: cloudinfo [-z] [-d] pid eid\n";
exit(1);
}
my %options = ();
if (!getopts("z", \%options)) {
if (!getopts("zd", \%options)) {
usage();
}
if (defined($options{"z"})) {
$zeroem = 1;
}
if (defined($options{"d"})) {
$dumpfile = 1;
}
if (@ARGV != 2) {
usage();
}
......@@ -47,6 +53,10 @@ if ($nnodes == 0) {
exit(1);
}
if ($dumpfile) {
print "$pid $eid\n";
}
for my $node (@nodelist) {
next
if ($node !~ /^tbs?delay/);
......@@ -72,7 +82,7 @@ sub printit($)
{
my ($node) = @_;
print "\n$node:\n";
print "\n$node:\n" unless $dumpfile;
my @pipes =
sort {
$pipeinfo{$a}->{"node"} cmp $pipeinfo{$b}->{"node"} ||
......@@ -97,18 +107,18 @@ sub printit($)
}
if (defined($lastdir) && $lastdir ne $pipeinfo{$pipe}->{"dir"} ||
defined($lastnode) && $lastnode ne $pipeinfo{$pipe}->{"node"}) {
print "\n";
print "\n" unless $dumpfile;
}
printapipe($pipe);
$lastnode = $pipeinfo{$pipe}->{"node"};
$lastdir = $pipeinfo{$pipe}->{"dir"};
}
print "\n";
print "\n" unless $dumpfile;
foreach $pipe (@anypipes) {
printapipe($pipe);
}
if ($verbose && @badpipes) {
print "*** Ignored pipes with traffic:\n";
if ($verbose && @badpipes && !$dumpfile) {
print STDERR "*** Ignored pipes with traffic:\n";
foreach $pipe (@badpipes) {
printapipe($pipe);
}
......@@ -119,27 +129,44 @@ sub printapipe($)
{
my ($pipe) = @_;
printf "%8s %1s ", $pipeinfo{$pipe}->{"node"}, $pipeinfo{$pipe}->{"dir"};
my $node;
if ($ispelab) {
my $node = $pipeinfo{$pipe}->{"ip"};
$node = $pipeinfo{$pipe}->{"ip"};
if ($node =~ /^10\.0\.0\.(\d+)$/) {
$node = "elab-$1";
}
printf "%8s: ", $node;
$node = sprintf "%8s", $node unless $dumpfile;
} else {
printf "%16s: ", $pipeinfo{$pipe}->{"ip"};
$node = $pipeinfo{$pipe}->{"ip"};
$node = sprintf "%16s", $node unless $dumpfile;
}
my $bw = $pipeinfo{$pipe}->{"bw"};
if ($bw eq "unlimited") {
print " unlimited";
} else {
printf "%10d", $bw;
if (!$dumpfile) {
printf "%8s %1s ", $pipeinfo{$pipe}->{"node"}, $pipeinfo{$pipe}->{"dir"};
print "$node: ";
if ($bw eq "unlimited") {
print " unlimited";
} else {
printf "%10d", $bw;
}
printf ", %4dms", $pipeinfo{$pipe}->{"delay"};
printf ", %4.1f%%", $pipeinfo{$pipe}->{"plr"};
printf ", %10d", $pipeinfo{$pipe}->{"pkts"};
printf ", %10d", $pipeinfo{$pipe}->{"bytes"};
print "\n";
} elsif ($node ne $pipeinfo{$pipe}{node}) {
if ($pipeinfo{$pipe}->{"dir"} eq ">") {
print "$pipeinfo{$pipe}{node} $node ";
} else {
print "$node $pipeinfo{$pipe}{node} ";
}
$bw /= 1000;
print "$bw $pipeinfo{$pipe}{delay} $pipeinfo{$pipe}{plr}\n";
}
printf ", %4dms", $pipeinfo{$pipe}->{"delay"};
printf ", %4.1f%%", $pipeinfo{$pipe}->{"plr"};
printf ", %10d", $pipeinfo{$pipe}->{"pkts"};
printf ", %10d", $pipeinfo{$pipe}->{"bytes"};
print "\n";
}
sub parseit($)
......@@ -175,7 +202,7 @@ sub parseit($)
$dir = "<";
$node = $inif2node{$iface};
} else {
print "*** unknown interface $iface\n";
print STDERR "*** unknown interface $iface\n";
}
$pipeinfo{$pipe} = {
......@@ -207,7 +234,7 @@ sub parseit($)
if ($node =~ /^elab-(\d+)$/) {
$nodeix = $1;
} else {
print "*** ignoring non-pelab rule: $rule\n";
print STDERR "*** ignoring non-pelab rule: $rule\n";
$pipeinfo{$pipe}->{"ignore"} = 1;
next;
}
......@@ -223,7 +250,7 @@ sub parseit($)
next;
}
} else {
print "*** ignoring non-pelab rule: $rule\n";
print STDERR "*** ignoring non-pelab rule: $rule\n";
$pipeinfo{$pipe}->{"ignore"} = 1;
next;
}
......@@ -249,7 +276,7 @@ sub parseit($)
}
if (!exists($pipeinfo{$pipe})) {
print "*** unreferenced pipe $pipe\n";
print STDERR "*** unreferenced pipe $pipe\n";
} else {
$pipeinfo{$pipe}->{"bw"} = $bw;
$pipeinfo{$pipe}->{"delay"} = $delay;
......@@ -275,7 +302,7 @@ sub parseit($)
foreach $pipe (keys %pipeinfo) {
if (!exists($pipeinfo{$pipe}->{"bw"})) {
print "*** no info for pipe $pipe\n";
print STDERR "*** no info for pipe $pipe\n";
}
}
}
Date: Wed, 16 Aug 2006 14:48:28 -0600
From: Mike Hibler <mike@flux.utah.edu>
To: pelab@flux.utah.edu
Subject: monitoring your "cloud" shaping
During the previous paper crunch I had written a little perl script
~mike/parsepipe.pl
to dump the IPFW tables on delay nodes so you could see how things were setup.
I have since made the output a little more understandable. It prints out a
section per delay node, ala:
tbdelay4:
elab-5 < elab-5: 100000000, 0ms, 0.0%, 194179, 238270680
elab-5 > elab-1: 2020000, 108ms, 0.0%, 23790, 1318245
elab-5 > elab-2: 1257000, 211ms, 0.0%, 34024, 38376164
elab-5 > elab-3: 100000, 179ms, 0.0%, 1768, 1773906
elab-5 > elab-4: 4009000, 60ms, 0.0%, 36499, 50793730
elab-5 > elab-6: 6000000, 2ms, 0.0%, 91105, 124302317
elab-6 < elab-6: 100000000, 0ms, 0.0%, 173572, 236836570
elab-6 > elab-1: 2340000, 90ms, 0.0%, 26841, 1487517
elab-6 > elab-2: 1197000, 162ms, 0.0%, 27187, 34443151
elab-6 > elab-3: 100000, 171ms, 0.0%, 3363, 4429941
elab-6 > elab-4: 100000, 100ms, 0.0%, 2159, 2536567
elab-6 > elab-5: 14976000, 3ms, 0.0%, 78294, 85779645
*** Ignored pipes with traffic:
elab-5 < any: 100000000, 0ms, 0.0%, 41, 3918
elab-5 > any: 100000000, 0ms, 0.0%, 9, 414
elab-6 < any: 100000000, 0ms, 0.0%, 39, 3774
elab-6 > any: 100000000, 0ms, 0.0%, 9, 414
where each line consists of the node we are shaping for, the direction
("<" in from the cloud, ">" out to the cloud), the destination for the
packets,
the bandwidth/delay/loss and the number of packets/bytes through the pipe.
The first line ("elab-5 < elab-5") is for the rule used for all traffic coming
off of the cloud for the node we are shaping. This one should be unshaped,
as per our strategy of shaping only outbound traffic to the cloud/lan.
The second bunch of lines is for our shaped node out to the individual other
nodes in the cloud.
Then there is a another group of lines for the other node that we are shaping
for ("elab-6").
"Ignored pipes with traffic" are those which should not be in use, but
have traffic counts. Rules involving "any" and small counts are ok, as they
are the generic shaping rules that were in use before the cloud rules got set
up. The counts here should not increase after the cloud is "up".
---------------------------------------------------------------------------
The file parsepipe.pl is now checked in as "cloudinfo".
---------------------------------------------------------------------------
Date: Tue, 22 Aug 2006 15:25:50 -0600 (MDT)
From: Kevin Atkinson <kevina@cs.utah.edu>
To: pelab@flux.utah.edu
Subject: Setting And Restoring Seeting For Elab Cloud
It is now possible to save and restore the elab "cloud" settings.
I hacked Mike's cloudinfo script to dump the settings in a form that is easy
to parse, and then wrote a script to read in those settings and make the
appropriate tenv calls.
To save them:
cloudinfo -d PID EID > dump.txt
And then to restore:
./cloudinfo-set < dump.txt
No guarantee this will work on a non elab experiment.
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