Commit 4acd0bfe authored by Leigh Stoller's avatar Leigh Stoller

A fix to the alloc state machine; on the Geni Path we do two mapper

runs, the first in "alloconly" mode to nalloc resources, the second to
"commit" the actual physical state changes. Well when we do that we end
up changing newly allocated nodes to node that are dirty. This turns out
to be bad for the switch ossetup code, and since the above is wrong, I
decided to fix it instead of change David's switch ossetup code.
parent e412f7db
......@@ -4479,7 +4479,8 @@ sub SliverWorkAux($)
DebugTimeStamp("Starting mapper");
# Add -u for update mode, but not -f (fixnode).
my $output = GeniUtil::ExecQuiet("$MAPPER -d -v $solfile -z -u $pid $eid");
my $output =
GeniUtil::ExecQuiet("$MAPPER -b -d -v $solfile -z -u $pid $eid");
if ($?) {
my $logstuff = "";
$message = "Could not map to resources";
......
#!/usr/bin/perl -w
#
# Copyright (c) 2005-2011, 2013 University of Utah and the Flux Group.
# Copyright (c) 2005-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -29,7 +29,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK
$VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_QUIET
$VTOP_FLAGS_FIXNODES $VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_ALLOCONLY
$VTOP_FLAGS_REGRESSION $VTOP_FLAGS_FIXLANNODES
$VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_PREASSIGN $VTOP_FLAGS_COMMITMODE);
@ISA = "Exporter";
@EXPORT = qw( );
......@@ -50,10 +50,12 @@ $VTOP_FLAGS_QUIET = 0x0;
$VTOP_FLAGS_ALLOCONLY = 0x0;
$VTOP_FLAGS_FIXLANNODES = 0x0;
$VTOP_FLAGS_PREASSIGN = 0x0;
$VTOP_FLAGS_COMMITMODE = 0x0;
@EXPORT_OK = qw($VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_FIXNODES
$VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_REGRESSION $VTOP_FLAGS_QUIET
$VTOP_FLAGS_ALLOCONLY $VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_ALLOCONLY $VTOP_FLAGS_PREASSIGN
$VTOP_FLAGS_COMMITMODE);
sub Init($$$)
{
......@@ -76,6 +78,7 @@ sub Init($$$)
$VTOP_FLAGS_ALLOCONLY = $libvtop_test::VTOP_FLAGS_ALLOCONLY;
$VTOP_FLAGS_FIXLANNODES = $libvtop_test::VTOP_FLAGS_FIXLANNODES;
$VTOP_FLAGS_PREASSIGN = $libvtop_test::VTOP_FLAGS_PREASSIGN;
$VTOP_FLAGS_COMMITMODE = $libvtop_test::VTOP_FLAGS_COMMITMODE;
}
else {
require libvtop_stable;
......@@ -89,6 +92,7 @@ sub Init($$$)
$VTOP_FLAGS_ALLOCONLY = $libvtop_stable::VTOP_FLAGS_ALLOCONLY;
$VTOP_FLAGS_FIXLANNODES = $libvtop_stable::VTOP_FLAGS_FIXLANNODES;
$VTOP_FLAGS_PREASSIGN = $libvtop_stable::VTOP_FLAGS_PREASSIGN;
$VTOP_FLAGS_COMMITMODE = $libvtop_stable::VTOP_FLAGS_COMMITMODE;
}
return 0;
}
......
#!/usr/bin/perl -w
#
# Copyright (c) 2005-2017 University of Utah and the Flux Group.
# Copyright (c) 2005-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -29,7 +29,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK
$VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_QUIET
$VTOP_FLAGS_FIXNODES $VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_ALLOCONLY
$VTOP_FLAGS_REGRESSION $VTOP_FLAGS_FIXLANNODES
$VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_PREASSIGN $VTOP_FLAGS_COMMITMODE);
@ISA = "Exporter";
@EXPORT = qw( );
......@@ -86,11 +86,12 @@ $VTOP_FLAGS_QUIET = 0x20;
$VTOP_FLAGS_ALLOCONLY = 0x40;
$VTOP_FLAGS_FIXLANNODES = 0x80;
$VTOP_FLAGS_PREASSIGN = 0x100;
$VTOP_FLAGS_COMMITMODE = 0x200;
@EXPORT_OK = qw($VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_FIXNODES
$VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_REGRESSION $VTOP_FLAGS_QUIET
$VTOP_FLAGS_ALLOCONLY $VTOP_FLAGS_FIXLANNODES
$VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_PREASSIGN $VTOP_FLAGS_COMMITMODE);
#
# Create an object representing the stuff we need to create the vtop file.
......
......@@ -29,7 +29,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK
$VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_QUIET
$VTOP_FLAGS_FIXNODES $VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_ALLOCONLY
$VTOP_FLAGS_REGRESSION $VTOP_FLAGS_FIXLANNODES
$VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_PREASSIGN $VTOP_FLAGS_COMMITMODE);
@ISA = "Exporter";
@EXPORT = qw( );
......@@ -86,11 +86,12 @@ $VTOP_FLAGS_QUIET = 0x20;
$VTOP_FLAGS_ALLOCONLY = 0x40;
$VTOP_FLAGS_FIXLANNODES = 0x80;
$VTOP_FLAGS_PREASSIGN = 0x100;
$VTOP_FLAGS_COMMITMODE = 0x200;
@EXPORT_OK = qw($VTOP_FLAGS_UPDATE $VTOP_FLAGS_VERBOSE $VTOP_FLAGS_FIXNODES
$VTOP_FLAGS_IMPOTENT $VTOP_FLAGS_REGRESSION $VTOP_FLAGS_QUIET
$VTOP_FLAGS_ALLOCONLY $VTOP_FLAGS_FIXLANNODES
$VTOP_FLAGS_PREASSIGN);
$VTOP_FLAGS_PREASSIGN $VTOP_FLAGS_COMMITMODE);
#
# Create an object representing the stuff we need to create the vtop file.
......@@ -247,6 +248,7 @@ sub impotent($) { return $_[0]->flags() & $VTOP_FLAGS_IMPOTENT; }
sub alloconly($) { return $_[0]->flags() & $VTOP_FLAGS_ALLOCONLY; }
sub regression($) { return $_[0]->flags() & $VTOP_FLAGS_REGRESSION; }
sub preassign($) { return $_[0]->flags() & $VTOP_FLAGS_PREASSIGN; }
sub commitmode($) { return $_[0]->flags() & $VTOP_FLAGS_COMMITMODE; }
sub printdb($$) { print $_[1] if ($_[0]->verbose()); return 1; }
# We name delay nodes internally as they are needed.
......@@ -5599,8 +5601,16 @@ sub AllocNodes($)
# Node is being reused, but for a different purpose, so
# it should be rebooted.
#
# XXX Note that when we use alloconly mode, and then we
# "commit" the allocations, we do not want to change the
# allocstate cause that messes up os_setup later. This is
# relevant to the Geni path only.
#
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_REBOOT())
if (! $self->impotent());
if (! ($self->impotent() ||
($self->commitmode() &&
$pnode->allocstate() eq
TBDB_ALLOCSTATE_RES_INIT_DIRTY())));
}
}
skip:
......@@ -6608,8 +6618,9 @@ sub InterpLinksAux($)
# sees that wire (as for snmpit).
#
my $logicalwire =
Interface::LogicalWire->Create($self->impotent() ||
$self->alloconly(),
Interface::LogicalWire->Create(($self->impotent() ||
$self->alloconly()
? 1 : 0),
$nodeA, $portA,
$nodeB, $portB);
return -1
......
......@@ -72,7 +72,7 @@ sub usage ()
print STDERR " -A - Tell ptopgen all nodes are free; only with -n\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:altzZACFNL:S:G";
my $optlist = "dvunfprqczxm:ko:abltzZACFNL:S:G";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
......@@ -84,6 +84,7 @@ my $allnodesfree = 0;
my $toponly = 0;
my $prepass = 0;
my $alloconly = 0;
my $commitmode = 0;
my $gblinkcheck= 0;
my $outfile;
my $mfactor;
......@@ -181,6 +182,9 @@ if (defined($options{"v"})) {
if (defined($options{"a"})) {
$alloconly++;
}
if (defined($options{"b"})) {
$commitmode++;
}
if (defined($options{"A"})) {
$allnodesfree++;
}
......@@ -344,6 +348,8 @@ $vtopflags |= $libvtop::VTOP_FLAGS_IMPOTENT
if ($impotent);
$vtopflags |= $libvtop::VTOP_FLAGS_ALLOCONLY
if ($alloconly);
$vtopflags |= $libvtop::VTOP_FLAGS_COMMITMODE
if ($commitmode);
$vtopflags |= $libvtop::VTOP_FLAGS_REGRESSION
if ($regression);
......
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