Index: fedd/federation/experiment_partition.py
===================================================================
--- fedd/federation/experiment_partition.py	(revision 73e7f5c740b5090ac7be4a376cdb81c6f98221a5)
+++ fedd/federation/experiment_partition.py	(revision 5f96438d920af0e07966b3c8545e9183b92492f8)
@@ -56,5 +56,5 @@
 
 
-    def new_portal_node(self, st, dt, tbparams, master, eid, myname, desthost,
+    def new_portal_node(self, st, dt, tbparams, masters, eid, myname, desthost,
 	    portal_type, iface_desc=(), conn_type="ssh", conn_attrs=[], 
 	    expid=None):
@@ -63,13 +63,27 @@
 	be attached.
 	"""
+	seer_master = None
+	for k, s in masters.items():
+	    if 'SEER' in s:
+		seer_master = k
+		break
+
+	if seer_master:
+	    mdomain = tbparams[seer_master].get('domain', '.example.com')
+	    mproject = tbparams[seer_master].get('project', 'project')
+	    muser = tbparams[seer_master].get('user', 'root')
+	    smbshare = tbparams[seer_master].get('smbshare', 'USERS')
+	else:
+	    mdomain = '.example.com'
+	    mproject = 'project'
+	    muser = 'root'
+	    smbshare = 'USERS'
+
 	dproject = tbparams[dt].get('project', 'project')
 	ddomain = tbparams[dt].get('domain', ".example.com")
-	mdomain = tbparams[master].get('domain', '.example.com')
-	mproject = tbparams[master].get('project', 'project')
-	muser = tbparams[master].get('user', 'root')
-	smbshare = tbparams[master].get('smbshare', 'USERS')
-
-	if st == master or dt == master:
-	    active = ("%s" % (st == master))
+
+	if (st in masters and dt not in masters) or \
+		( st in masters and dt not in masters ):
+	    active = ("%s" % (st in masters))
 	else:
 	    active = ("%s" % (st > dt))
@@ -249,5 +263,5 @@
 			)
 
-    def create_dragon_substrate(self, sub, topo, tbs, tbparams, master, eid,
+    def create_dragon_substrate(self, sub, topo, tbs, tbparams, masters, eid,
 	    connInfo, expid=None):
 	"""
@@ -263,6 +277,17 @@
 
 
-	mdomain = tbparams[master].get('domain', '.example.com')
-	mproject = tbparams[master].get('project', 'project')
+	seer_master = None
+	for k, s in masters.items():
+	    if 'SEER' in s:
+		seer_master = k
+		break
+
+	if seer_master:
+	    mdomain = tbparams[seer_master].get('domain', '.example.com')
+	    mproject = tbparams[seer_master].get('project', 'project')
+	else:
+	    mdomain = '.example.com'
+	    mproject = 'project'
+
 	# dn is the number of previously created dragon nets.  This routine
 	# creates a net numbered by dn
@@ -295,6 +320,6 @@
 		# This may need another look, but only a service gateway will
 		# look at the active parameter, and these are only inserted to
-		# connect to the master.
-		active = "%s" % ( tb == master)
+		# connect to a master.
+		active = "%s" % ( tb in masters)
 		info = {
 			'type': 'transit',
@@ -332,5 +357,5 @@
 	self.new_dragon_topo(dn, sub, topo, tbs, tbparams, connInfo, expid)
 
-    def insert_internet_portals(self, sub, topo, tbs, tbparams, master, eid,
+    def insert_internet_portals(self, sub, topo, tbs, tbparams, masters, eid,
 	    segment_substrate, portals, connInfo, expid):
 	# More than one testbed is on this substrate.  Insert
@@ -347,15 +372,31 @@
 		sproject = tbparams[st].get('project', 'project')
 		dproject = tbparams[dt].get('project', 'project')
-		mproject = tbparams[master].get('project', 'project')
 		sdomain = tbparams[st].get('domain', ".example.com")
 		ddomain = tbparams[dt].get('domain', ".example.com")
-		mdomain = tbparams[master].get('domain', '.example.com')
-		muser = tbparams[master].get('user', 'root')
-		smbshare = tbparams[master].get('smbshare', 'USERS')
 		aid = tbparams[dt]['allocID']['fedid']
-		if st == master or dt == master:
-		    active = ("%s" % (st == master))
+
+		seer_master = None
+		for k, s in masters.items():
+		    if 'SEER' in s:
+			seer_master = k
+			break
+
+		if seer_master:
+		    mdomain = tbparams[seer_master].get('domain', '.example.com')
+		    mproject = tbparams[seer_master].get('project', 'project')
+		    muser = tbparams[seer_master].get('user', 'root')
+		    smbshare = tbparams[seer_master].get('smbshare', 'USERS')
+		else:
+		    mdomain = '.example.com'
+		    mproject = 'project'
+		    muser = 'root'
+		    smbshare = 'USERS'
+
+		if (st in masters  and dt not in masters) or \
+			(st not in masters and dt in masters):
+		    active = ("%s" % (st in masters))
 		else:
 		    active = ("%s" %(st > dt))
+
 		if not segment_substrate[st].has_key(dt):
 		    # Put a substrate and a segment for the connected
@@ -404,5 +445,5 @@
 		    desthost = "%stunnel%d" % (st.lower(), len(portals[st][dt]))
 
-		    if dt == master or st == master: portal_type = "both"
+		    if dt in masters or st in masters: portal_type = "both"
 		    else: portal_type = "experiment"
 
@@ -415,5 +456,5 @@
 			)
 		    portal, info  =  self.new_portal_node(st, dt, tbparams, 
-			    master, eid, myname, desthost, portal_type,
+			    masters, eid, myname, desthost, portal_type,
 			    infs, conn_type="ssh", conn_attrs=[], expid=expid)
 
@@ -422,5 +463,5 @@
 		    connInfo[st].append(info)
 
-    def add_control_portal(self, st, dt, master, eid, topo, tbparams, connInfo, expid):
+    def add_control_portal(self, st, dt, masters, eid, topo, tbparams, connInfo, expid):
 	# Add to the master testbed
 	tsubstrate, segment_element = \
@@ -429,5 +470,5 @@
 	desthost = "%stunnel" % st
 
-	portal, info = self.new_portal_node(st, dt, tbparams, master,
+	portal, info = self.new_portal_node(st, dt, tbparams, masters,
 		eid, myname, desthost, "control", 
 		((tsubstrate.name,(('portal','true'),)),), conn_type="ssh",
@@ -441,5 +482,5 @@
 	connInfo[st].append(info)
 
-    def new_dragon_portal(self, st, dt, master, eid, myip, dip, idx, 
+    def new_dragon_portal(self, st, dt, masters, eid, myip, dip, idx, 
 	    substrate, tbparams, expid):
 	# Add to the master testbed
@@ -447,5 +488,5 @@
 	desthost = "%s" % ip_addr(dip)
 
-	portal, info = self.new_portal_node(st, dt, tbparams, master,
+	portal, info = self.new_portal_node(st, dt, tbparams, masters,
 		eid, myname, desthost, "control", 
 		((substrate.name,(
@@ -456,5 +497,5 @@
 	return portal
 
-    def add_portals(self, top, topo, eid, master, tbparams, ip_allocator, 
+    def add_portals(self, top, topo, eid, masters, tbparams, ip_allocator, 
 	    connInfo, expid):
 	"""
@@ -483,11 +524,12 @@
 		    all([tbparams[x].has_key('dragon') for x in tbs]):
 		self.create_dragon_substrate(s, topo, tbs, tbparams, 
-			master, eid, connInfo, expid)
+			masters, eid, connInfo, expid)
 	    else:
-		self.insert_internet_portals(s, topo, tbs, tbparams, master,
+		self.insert_internet_portals(s, topo, tbs, tbparams, masters,
 			eid, segment_substrate, portals, connInfo, expid)
 
-	# Make sure that all the slaves have a control portal back to the
-	# master.
+	# Make sure that all the service importers have a control portal back
+	# to the master for each service.
+	#XXX you're here
 	for tb in [ t for t in tbparams.keys() if t != master ]:
 	    if len([e for e in topo[tb].elements \
