Commit 65e807a3 authored by Mike Hibler's avatar Mike Hibler

Further hackery to deal with more than 254 physical nodes in the testbed

when assigning vnode (control net) IP addresses.  Once we hit 255, we
increment the low bit of the network address ala:

	on pc254: 172.16.254.N
	on pc255: 172.17.1.N

Note that the Utah case is different than the default in that we wrap at
200 rather than 254.  This is so that we "wrap" at the boundary of the
new cluster (which starts at pc201); i.e., pc201 has addresses 172.18.1.N.
parent 2577ee86
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -35,6 +35,9 @@ use lib '@prefix@/lib';
use English;
use libdb;
# XXX stinky hack detection
my $ISUTAH = @TBMAINSITE@;
#
# Cache the node structures to avoid repeated lookups. It is up to the
# user to request nodes be synched with the DB if they think that is
......@@ -251,8 +254,11 @@ sub CreateVnodes($$)
# Need IP for jailed nodes.
#
my $IPBASE = TBDB_JAILIPBASE();
my $IPBASE1;
my $IPBASE2;
if ($IPBASE =~ /^(\d+).(\d+).(\d+).(\d+)/) {
$IPBASE = "$1.$2";
$IPBASE1 = $1;
$IPBASE2 = $2;
}
else {
print STDERR "*** CreateVnodes: Bad IPBASE '$IPBASE'\n";
......@@ -311,9 +317,27 @@ sub CreateVnodes($$)
#
foreach my $i (@tocreate) {
my $vpriority = 10000000 + ($nodenum * 1000) + $i;
my $jailip = "${IPBASE}." . int(${nodenum}) . ".${i}";
my $vnodeid = $nodeprefix . "vm" . $nodenum . "-" . $i;
#
# Construct the vnode IP. The general form is:
# <IPBASE1>.<IPBASE2>.<pnode>.<vnode>
# but if <pnode> is greater than 254 we have to increment
# IPBASE2.
#
# XXX at Utah our second big cluster of nodes starts at
# nodenum=201 and I would like our vnode IPs to align
# at that boundary, so 254 becomes 200.
#
my $nodenumlimit = $ISUTAH ? 200 : 254;
my $pnet = $IPBASE2;
my $pnode2 = $nodenum;
while ($pnode2 > $nodenumlimit) {
$pnet++;
$pnode2 -= $nodenumlimit;
}
my $jailip = "${IPBASE1}.${pnet}.${pnode2}.${i}";
if ($verbose) {
if ($impotent) {
print "Would allocate $vnodeid on $pnode ($vtype, $osid)\n";
......
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