Commit bd5ea203 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Okay, I think I got tunnels working again. Note the changes in

test/tuntest.py wrt putting the sliver_uuid into the rspecs.

Added "hostname" to host resolve.
Added check for "protogeni_exclude" attribute when filling a
wildcarded uuid.
parent 09980c07
......@@ -55,6 +55,7 @@ my $TBAPPROVAL = "@TBAPPROVALEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@";
my $BOSSNODE = "@BOSSNODE@";
my $OURDOMAIN = "@OURDOMAIN@";
my $PGENIDOMAIN = "@PROTOGENI_DOMAIN@";
my $CREATEEXPT = "$TB/bin/batchexp";
my $ENDEXPT = "$TB/bin/endexp";
my $NALLOC = "$TB/bin/nalloc";
......@@ -128,9 +129,10 @@ sub Resolve($)
}
# Return a blob.
my $blob = { "hrn" => "${OURDOMAIN}." . $node->node_id(),
my $blob = { "hrn" => "${PGENIDOMAIN}." . $node->node_id(),
"uuid" => $node->uuid(),
"role" => $node->role(),
"hostname" => $node->node_id() . ".${OURDOMAIN}",
};
#
......@@ -561,6 +563,8 @@ sub GetTicket($)
my $node_uuid = $ref->{'node_uuid'};
my $node_nickname = $ref->{'node_nickname'};
my $iface_name = $ref->{'iface_name'};
my $istunnel = (exists($linkref->{'link_type'}) &&
$linkref->{'link_type'} eq "tunnel");
if (!defined($node_nickname)) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......@@ -568,15 +572,16 @@ sub GetTicket($)
goto bad;
}
# XXX No wildcarding for tunnels.
if (exists($linkref->{'link_type'}) &&
$linkref->{'link_type'} eq "tunnel") {
if ($node_uuid eq "*") {
# XXX No wildcarding for tunnels unless its a node from above.
if ($istunnel) {
if ($node_uuid eq "*" && !exists($namemap{$node_nickname})) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Tunnels cannot be wildcarded");
goto bad;
}
next;
# Not a local node, so skip.
next
if (!exists($namemap{$node_nickname}));
}
# Map the nickname to the actual sliver (node) request.
......@@ -591,6 +596,9 @@ sub GetTicket($)
}
# and the sliver_uuid we assigned above.
$ref->{'sliver_uuid'} = $sliver_uuid;
next
if ($istunnel);
#
# Now do wildcarded interfaces.
......@@ -831,7 +839,6 @@ sub ModifySliver($$$$$$)
#
# Figure out what nodes to allocate or free.
#
my %namemap = ();
my %nodelist = ();
my %linklist = ();
my %toalloc = ();
......@@ -1148,14 +1155,19 @@ sub ModifySliver($$$$$$)
my $node1ref = (@{$linkref->{'linkendpoints'}})[0];
my $node2ref = (@{$linkref->{'linkendpoints'}})[1];
my $node1sliver_uuid = $namemap{$node1ref->{'sliver_uuid'}};
my $node2sliver_uuid = $namemap{$node2ref->{'sliver_uuid'}};
my $node1sliver = $slivers{$node1sliver_uuid} ||
$nodelist{$node1sliver_uuid};
my $node2sliver = $slivers{$node2sliver_uuid} ||
$nodelist{$node2sliver_uuid};
my $node1sliver_uuid = $node1ref->{'sliver_uuid'};
my $node2sliver_uuid = $node2ref->{'sliver_uuid'};
my $node1sliver;
my $node2sliver;
if (defined($node1sliver_uuid)) {
$node1sliver = $slivers{$node1sliver_uuid} ||
$nodelist{$node1sliver_uuid};
}
if (defined($node2sliver_uuid)) {
$node2sliver = $slivers{$node2sliver_uuid} ||
$nodelist{$node2sliver_uuid};
}
my $tunnel = GeniAggregate::Tunnel->Create($slice,
$owner,
......@@ -2528,6 +2540,14 @@ sub FindFreeNode($@)
next
if (grep {$_ eq $node->node_id()} @nodeids);
my $nodetype = $node->NodeTypeInfo();
next
if (!defined($nodetype));
my $exclude = $nodetype->GetAttribute("protogeni_exclude");
next
if (defined($exclude) && $exclude);
#
# See if the node is already reserved.
#
......
#! /usr/bin/env python
#
# EMULAB-COPYRIGHT
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -117,8 +117,11 @@ if rval:
Fatal("Could not get a list of components from the ClearingHouse")
pass
components = response["value"];
url1 = components[0]["url"]
url2 = components[1]["url"]
#url1 = components[0]["url"]
#url2 = components[1]["url"]
#url1 = "https://myboss.myelab.testbed.emulab.net/protogeni/xmlrpc/cm"
#url2 = "https://www.emulab.net/protogeni/stoller/xmlrpc/cm"
#
# Get a ticket for a node on a CM.
......@@ -147,13 +150,15 @@ ticket_element = findElement("ticket", ticket1)
node_element = findElement("node", str(ticket_element.string))
uuid_element = findElement("uuid", str(node_element.string))
node1_uuid = uuid_element.value
uuid_element = findElement("sliver_uuid", str(node_element.string))
node1_sliveruuid = uuid_element.value
#
# Get a ticket for a node on another CM.
#
rspec2 = "<rspec xmlns=\"http://protogeni.net/resources/rspec/0.1\"> " +\
" <node uuid=\"*\" " +\
" nickname=\"geni1\" "+\
" nickname=\"geni2\" "+\
" virtualization_type=\"emulab-vnode\"> " +\
" </node>" +\
"</rspec>"
......@@ -175,6 +180,8 @@ ticket_element = findElement("ticket", ticket2)
node_element = findElement("node", str(ticket_element.string))
uuid_element = findElement("uuid", str(node_element.string))
node2_uuid = uuid_element.value
uuid_element = findElement("sliver_uuid", str(node_element.string))
node2_sliveruuid = uuid_element.value
#
# Create the slivers.
......@@ -202,6 +209,7 @@ print "Created a sliver on CM2"
#
rspec1 = "<rspec xmlns=\"http://protogeni.net/resources/rspec/0.1\"> " +\
" <node uuid=\"" + node1_uuid + "\" " +\
" sliver_uuid=\"" + node1_sliveruuid + "\" " +\
" nickname=\"geni1\" "+\
" virtualization_type=\"emulab-vnode\"> " +\
" </node>" +\
......@@ -209,10 +217,12 @@ rspec1 = "<rspec xmlns=\"http://protogeni.net/resources/rspec/0.1\"> " +\
" <linkendpoints nickname=\"destination_interface\" " +\
" tunnel_ip=\"192.168.1.1\" " +\
" node_nickname=\"geni1\" " +\
" sliver_uuid=\"" + node1_sliveruuid + "\" " +\
" node_uuid=\"" + node1_uuid + "\" /> " +\
" <linkendpoints nickname=\"source_interface\" " +\
" tunnel_ip=\"192.168.1.2\" " +\
" node_nickname=\"geni2\" " +\
" sliver_uuid=\"" + node2_sliveruuid + "\" " +\
" node_uuid=\"" + node2_uuid + "\" /> " +\
" </link> " +\
"</rspec>"
......@@ -231,6 +241,7 @@ print "Updated sliver on CM1 with tunnel stuff"
#
rspec2 = "<rspec xmlns=\"http://protogeni.net/resources/rspec/0.1\"> " +\
" <node uuid=\"" + node2_uuid + "\" " +\
" sliver_uuid=\"" + node2_sliveruuid + "\" " +\
" nickname=\"geni2\" "+\
" virtualization_type=\"emulab-vnode\"> " +\
" </node>" +\
......@@ -238,10 +249,12 @@ rspec2 = "<rspec xmlns=\"http://protogeni.net/resources/rspec/0.1\"> " +\
" <linkendpoints nickname=\"destination_interface\" " +\
" tunnel_ip=\"192.168.1.1\" " +\
" node_nickname=\"geni1\" " +\
" sliver_uuid=\"" + node1_sliveruuid + "\" " +\
" node_uuid=\"" + node1_uuid + "\" /> " +\
" <linkendpoints nickname=\"source_interface\" " +\
" tunnel_ip=\"192.168.1.2\" " +\
" node_nickname=\"geni2\" " +\
" sliver_uuid=\"" + node2_sliveruuid + "\" " +\
" node_uuid=\"" + node2_uuid + "\" /> " +\
" </link> " +\
"</rspec>"
......
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