Commit d9fa46bf authored by Leigh B Stoller's avatar Leigh B Stoller

Tweaks for what component_hops really look like.

parent edef810d
......@@ -1182,12 +1182,39 @@ sub GetTicketAuxAux($$$$$$$$$)
goto bad;
}
my (undef,undef,$hop_id) = GeniHRN::Parse($hop_urn);
print "$hop_id\n";
#
# An artifact of the way we convert physical links
# into urns is that we now have to undo that to
# figure out what node and interface. At the moment
# it looks like "link-ion:eth2-procurve-pgeni-wash:(null)"
#
my ($link,$iface,undef) = split(":", $hop_id);
if (! (defined($link) && defined($iface))) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$lanname: bad component_hop");
goto bad;
}
# and strip off the link- stuff.
my ($network_id) = ($link =~ /^link-(.*)$/);
# ditto for the iface cruft.
my ($iface_id) = ($iface =~ /^(eth\d*)/);
if (! ($network_id =~ /^[-\w]*$/ &&
$iface_id =~ /^[-\w]*$/)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$lanname: bad network or iface");
goto bad;
}
#
# Look in the external networks table to get the hop
# details.
#
my $network = ExternalNetwork->Lookup($hop_id);
my $network = ExternalNetwork->Lookup($network_id);
if (!defined($network)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......@@ -1224,7 +1251,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"desire" => "pcshared",
"weight" => 0.95});
$virtexperiment->encap_style("vlan");
$iface_name = "";
$iface_name = $iface_id;
$iface_vport = 0;
goto stitch;
}
......
......@@ -1712,9 +1712,24 @@ sub ReserveVlanTags($)
}
my $hop_urn = GeniXML::GetNodeId($hopref);
my (undef,undef,$hop_id) = GeniHRN::Parse($hop_urn);
print STDERR "$hop_urn\n";
my $network = ExternalNetwork->Lookup($hop_id);
#
# An artifact of the way we convert physical links
# into urns is that we now have to undo that to
# figure out what node and interface. At the moment
# it looks like "link-ion:eth2-procurve-pgeni-wash:(null)"
#
my ($link,$iface,undef) = split(":", $hop_id);
if (! (defined($link) && defined($iface))) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"badly specified component_hop");
goto done;
}
# and strip off the link- stuff.
my ($network_id) = ($link =~ /^link-(.*)$/);
my $network = ExternalNetwork->Lookup($network_id);
if (!defined($network)) {
$response = GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"$hop_urn is not an external network");
......
<rspec xmlns="http://www.protogeni.net/resources/rspec/0.1">
<node virtual_id="geni1"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+emulab.net+authority+cm">
<interface virtual_id="virt0"/>
<disk_image
<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/0.1 http://www.protogeni.net/resources/rspec/0.1/request.xsd"
type="request" >
<node virtual_id="geni1"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+emulab.net+authority+cm">
<node_type type_name="pc" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA8-OVZ-STD" />
</node>
<node virtual_id="geni2"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm">
<interface virtual_id="virt0"/>
<disk_image
</node>
<node virtual_id="geni2"
virtualization_type="emulab-vnode"
exclusive="1"
component_manager_urn="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm">
<node_type type_name="pc" type_slots="1"/>
<interface virtual_id="if0"/>
<disk_image
name="urn:publicid:IDN+emulab.net+image+emulab-ops//FEDORA8-OVZ-STD" />
</node>
<link virtual_id="link0">
<bandwidth>10000</bandwidth>
<interface_ref
virtual_interface_id="virt0"
virtual_node_id="geni1"
/>
<interface_ref
virtual_interface_id="virt0"
virtual_node_id="geni2"
/>
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm"/>
</link>
</node>
<link virtual_id="ionlink">
<component_manager
name="urn:publicid:IDN+emulab.net+authority+cm"/>
<component_manager
name="urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm"/>
<interface_ref virtual_node_id="geni1"
virtual_interface_id="if0" />
<interface_ref virtual_node_id="geni2"
virtual_interface_id="if0" />
<component_hop
component_urn="urn:publicid:IDN+emulab.net+link+link-ion%3Aeth2-procurve-pgeni-wash%3A(null)"/>
<component_hop
component_urn="urn:publicid:IDN+myelab.testbed.emulab.net+link+link-ion%3Aeth0-cisco1%3A(null)"/>
</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