Index: fedd/federation/emulab_access.py
===================================================================
--- fedd/federation/emulab_access.py	(revision 95be33607becdf5ffc12c8e621a5911d518185c8)
+++ fedd/federation/emulab_access.py	(revision 05c41f54e665212cd2973f55f9ce0df612eb5a53)
@@ -933,4 +933,5 @@
 	user = None
 	alloc_log = None
+	nonce_experiment = False
 	vchars_re = '[^' + string.ascii_letters + string.digits  + '-]'
 
@@ -973,4 +974,5 @@
 	    for i in range(0,5):
 		ename += random.choice(string.ascii_letters)
+	    nonce_experiment = True
 	    self.log.warn("No experiment name or suggestion too long: " + \
 		    "picked one randomly: %s" % ename)
@@ -988,4 +990,5 @@
 	    user = self.allocation[aid].get('user', None)
 	    self.allocation[aid]['experiment'] = ename
+	    self.allocation[aid]['nonce'] = nonce_experiment
 	    self.allocation[aid]['log'] = [ ]
 	    # Create a logger that logs to the experiment's state object as
@@ -1162,8 +1165,10 @@
 	    user = self.allocation[aid].get('user', None)
 	    ename = self.allocation[aid].get('experiment', None)
+	    nonce = self.allocation[aid].get('nonce', False)
 	else:
 	    proj = None
 	    user = None
 	    ename = None
+	    nonce = False
 	self.state_lock.release()
 
@@ -1183,4 +1188,4 @@
 	stopper = self.stop_segment(keyfile=self.ssh_privkey_file,
 		debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert)
-	stopper(self, user, proj, ename, gid)
+	stopper(self, user, proj, ename, gid, nonce)
 	return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
Index: fedd/federation/emulab_segment.py
===================================================================
--- fedd/federation/emulab_segment.py	(revision 95be33607becdf5ffc12c8e621a5911d518185c8)
+++ fedd/federation/emulab_segment.py	(revision 05c41f54e665212cd2973f55f9ce0df612eb5a53)
@@ -156,4 +156,28 @@
 	return code == 0
 
+    def terminate_exp(self, pid, eid, wait=True):
+	"""
+	Completely terminate experiment
+	"""
+	if self.debug:
+	    if self.log:
+		self.log.info("[swap_exp]: (debug) terminate %s" %  eid)
+	    return True
+	else:
+	    if self.log:
+		self.log.info("[swap_exp]: Terminating %s" % (eid)
+	    params = {
+		    'proj': pid,
+		    'exp': eid,
+		    'wait': wait,
+		    }
+	    code, value = self.emulab_call('experiment.endexp', params)
+
+	    if self.log:
+		if code == 0: self.log.info('[swap_exp]: Terminate succeeded')
+		else: self.log.error('[swap_exp]: Terminate failed: %s' % value)
+
+	return code == 0
+
     def modify_exp(self, pid, eid, tcl, wait=True):
 	if self.debug:
Index: fedd/federation/local_emulab_segment.py
===================================================================
--- fedd/federation/local_emulab_segment.py	(revision 95be33607becdf5ffc12c8e621a5911d518185c8)
+++ fedd/federation/local_emulab_segment.py	(revision 05c41f54e665212cd2973f55f9ce0df612eb5a53)
@@ -103,5 +103,5 @@
 	emulab_segment.__init__(self, boss=boss, cert=cert)
 
-    def __call__(self, parent, user, pid, eid, gid=None):
+    def __call__(self, parent, user, pid, eid, gid=None, terminate=False):
 	"""
 	Stop a sub experiment by calling swapexp on the federant
@@ -114,4 +114,6 @@
 	    self.cmd_with_timeout("rm -rf /proj/%s/software/%s" % (pid, eid))
 	    rv = self.swap_exp(pid, eid, 'out')
+	    if terminate:
+		rv = self.terminate_exp(pid, eid)
 	except self.cmd_timeout:
 	    rv = False
Index: fedd/federation/proxy_emulab_segment.py
===================================================================
--- fedd/federation/proxy_emulab_segment.py	(revision 95be33607becdf5ffc12c8e621a5911d518185c8)
+++ fedd/federation/proxy_emulab_segment.py	(revision 05c41f54e665212cd2973f55f9ce0df612eb5a53)
@@ -330,5 +330,5 @@
 	proxy_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
 
-    def __call__(self, parent, user, pid, eid, gid=None):
+    def __call__(self, parent, user, pid, eid, gid=None, terminate=False):
 	"""
 	Stop a sub experiment by calling swapexp on the federant
@@ -343,4 +343,7 @@
 	    rv = self.ssh_cmd(user, host,
 		    "/usr/testbed/bin/swapexp -w %s %s out" % (pid, eid))
+	    if terminate:
+		rv = self.ssh_cmd(user, host,
+			"/usr/testbed/bin/endexp -w %s %s" % (pid, eid))
 	except self.ssh_cmd_timeout:
 	    rv = False
