Commit 74c2e128 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Another changed 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. To do this, use a feature on the real switches called
real-switch:0 and when we mix pnodes and vnodes, ask for that feature
on the fake lan nodes; real-switch:1.0
parent 2fb7f5da
...@@ -2887,9 +2887,16 @@ sub GenVirtLans($) ...@@ -2887,9 +2887,16 @@ sub GenVirtLans($)
my $lannode = ($vlan->_geninodes() ? "lan-$vname" : "lan/$vname"); my $lannode = ($vlan->_geninodes() ? "lan-$vname" : "lan/$vname");
my $cmurn = ($vlan->_geninodes() ? my $cmurn = ($vlan->_geninodes() ?
$members[0]->virt_nodes()->_cmurn() : $mycmurn); $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. # Lan node for assign.
$self->createNode($lannode, $cmurn, "lan", '1', undef, $self->createNode($lannode, $cmurn, "lan", '1', $desires,
{ 'virtualization_type' => 'raw' , { 'virtualization_type' => 'raw' ,
'isgeninode' => $vlan->_geninodes() }); 'isgeninode' => $vlan->_geninodes() });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -1738,7 +1738,11 @@ sub print_switch ...@@ -1738,7 +1738,11 @@ sub print_switch
if (!(defined($MAINSITE) && $MAINSITE && $name eq "procurve1")) { if (!(defined($MAINSITE) && $MAINSITE && $name eq "procurve1")) {
push(@$types, "*lan:*"); 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); $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