Commit fab88c4a authored by Weibin Sun's avatar Weibin Sun
Browse files

merge with emulab-devel

parent 326a5628
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -394,7 +394,7 @@ foreach my $lan (sort keys(%lans)) {
my $havepmap = 0;
$query_result =
DBQueryFatal("select v.vname,n.node_id,n.phys_nodeid,n.type,".
" o.osid,o.OS,o.version,o.osfeatures".
" o.osid,o.OS,o.version,o.osfeatures,r.erole".
" from virt_nodes as v,reserved as r,nodes as n,os_info as o".
" where v.pid=r.pid and v.eid=r.eid and v.vname=r.vname".
" and r.node_id=n.node_id and n.def_boot_osid=o.osid and".
......@@ -416,11 +416,28 @@ if ($query_result->numrows) {
# Version 2 added osfeatures field
#
print $LTPOUT "V 2\n";
while (my ($vname,$node,$pnode,$ptype,$osid,$os,$osvers,$osfeatures) =
$query_result->fetchrow_array) {
while (my ($vname,$node,$pnode,$ptype,$osid,$os,$osvers,$osfeatures,$role)
= $query_result->fetchrow_array) {
$os = "UNKNOWN" if (!$os);
$osvers = "0" if (!$osvers);
$osfeatures = "UNKNOWN" if (!$osfeatures);
#
# Ugh. Nodes with role "virthost" can now be part of the explicit
# topology. Nothing wrong with that except that those nodes will
# not run linktest! To ensure that such a node does not get nominated
# as the coordinator for a linktest run, we remove the "linktest"
# attribute from osfeatures. This will tell the linktest script not
# to consider the node for that honor.
#
# One would think that we should just pass the node's role to linktest
# and let it decide for itself, but that would create another level
# of backward incompatibility.
#
if ($role eq "virthost" && $osfeatures =~ /linktest/) {
$osfeatures = join(',',
grep($_ ne "linktest",
split(',', $osfeatures)));
}
print $LTPOUT
"H $vname $node $pnode $ptype $osid $os $osvers $osfeatures\n";
}
......
......@@ -2887,9 +2887,16 @@ sub GenVirtLans($)
my $lannode = ($vlan->_geninodes() ? "lan-$vname" : "lan/$vname");
my $cmurn = ($vlan->_geninodes() ?
$members[0]->virt_nodes()->_cmurn() : $mycmurn);
# This is for mixing real nodes with pnodes in a lan. The goal
# is to prevent assign from putting the lan node on a pc;
# always prefer a real switch. See corresponding change in
# ptopgen.
my $desires = ($virtnodes && $nonvirtnodes ?
{"real-switch" => ['' , "1.0"]} : undef);
# Lan node for assign.
$self->createNode($lannode, $cmurn, "lan", '1', undef,
$self->createNode($lannode, $cmurn, "lan", '1', $desires,
{ 'virtualization_type' => 'raw' ,
'isgeninode' => $vlan->_geninodes() });
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -1738,7 +1738,11 @@ sub print_switch
if (!(defined($MAINSITE) && $MAINSITE && $name eq "procurve1")) {
push(@$types, "*lan:*");
}
print_node($name, $types, [], [], $uuid, $interfaces,
# This is for mixing real nodes with pnodes in a lan. The goal is to
# prevent assign from putting the lan node on a pc; always prefer a
# real switch. See corresponding change in libvtop.
my $features = ["real-switch:0"];
print_node($name, $types, $features, [], $uuid, $interfaces,
$country, $latitude, $longitude, undef);
}
......
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