Index: trunk/packages/sipb-xen-www/code/controls.py
===================================================================
--- trunk/packages/sipb-xen-www/code/controls.py	(revision 628)
+++ trunk/packages/sipb-xen-www/code/controls.py	(revision 629)
@@ -70,4 +70,16 @@
         lvcreate(machine, disk)
 
+def getswap(disksize, memsize):
+    """Returns the recommended swap partition size."""
+    return int(min(disksize / 4, memsize * 1.5))
+
+def lvinstall(machine, autoinstall):
+    disksize = machine.disks[0].size
+    memsize = machine.memory
+    imagesize = disksize - getswap(disksize, memsize)
+    ip = machine.nics[0].ip
+    remctl('web', 'install', machine.name, autoinstall.distribution,
+           autoinstall.mirror, str(imagesize), ip)
+
 def lvcopy(machine_orig_name, machine, rootpw):
     """Copy a golden image onto a machine's disk"""
@@ -93,5 +105,5 @@
                         % (err, machine.name, cdtype))
 
-def createVm(username, state, owner, contact, name, description, memory, disksize, machine_type, cdrom, clone_from):
+def createVm(username, state, owner, contact, name, description, memory, disksize, machine_type, cdrom, autoinstall):
     """Create a VM and put it in the database"""
     # put stuff in the table
@@ -131,6 +143,6 @@
         raise
     makeDisks(machine)
-    if clone_from:
-        lvcopy(clone_from, machine, 'password')
+    if autoinstall:
+        lvinstall(machine, autoinstall)
     # tell it to boot with cdrom
     bootMachine(machine, cdrom)
Index: trunk/packages/sipb-xen-www/code/main.py
===================================================================
--- trunk/packages/sipb-xen-www/code/main.py	(revision 628)
+++ trunk/packages/sipb-xen-www/code/main.py	(revision 629)
@@ -32,6 +32,4 @@
     atexit.register(printError)
 
-sys.path.append('/home/ecprice/.local/lib/python2.5/site-packages')
-
 import templates
 from Cheetah.Template import Template
@@ -137,10 +135,10 @@
 
 def parseCreate(username, state, fields):
-    kws = dict([(kw, fields.getfirst(kw)) for kw in 'name description owner memory disksize vmtype cdrom clone_from'.split()])
+    kws = dict([(kw, fields.getfirst(kw)) for kw in 'name description owner memory disksize vmtype cdrom autoinstall'.split()])
     validate = validation.Validate(username, state, strict=True, **kws)
     return dict(contact=username, name=validate.name, description=validate.description, memory=validate.memory,
                 disksize=validate.disksize, owner=validate.owner, machine_type=validate.vmtype,
                 cdrom=getattr(validate, 'cdrom', None),
-                clone_from=getattr(validate, 'clone_from', None))
+                autoinstall=getattr(validate, 'autoinstall', None))
 
 def create(username, state, fields):
@@ -626,10 +624,5 @@
 def getUser(environ):
     """Return the current user based on the SSL environment variables"""
-    email = environ.get('SSL_CLIENT_S_DN_Email', None)
-    if email is None:
-        return None
-    if not email.endswith('@MIT.EDU'):
-        return None
-    return email[:-8]
+    return environ.get('REMOTE_USER', None)
 
 class App:
Index: trunk/packages/sipb-xen-www/code/templates/list.tmpl
===================================================================
--- trunk/packages/sipb-xen-www/code/templates/list.tmpl	(revision 628)
+++ trunk/packages/sipb-xen-www/code/templates/list.tmpl	(revision 629)
@@ -67,18 +67,8 @@
 $errorRow('vmtype', $err)
 #end filter
-        <tr>
-          <td>Clone image?</td>
-#if $can_clone
-          <td><input type="checkbox" name="clone_from" id="clone_from" value="ice3" onchange="onclone(event)"/>
-              (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.)
-              <script type='text/javascript'>function onclone(e){ document.getElementById('cdromlist').value = ''; }</script></td>
-#else
-	  <td><input type="checkbox" name="clone_from" id="clone_from" value="ice3" disabled="disabled"/> Image cloning is currently disabled for maintenance</td>
-#end if
-        </tr>
 #filter None
 $errorRow('autoinstall', $err)
 #end filter
-	<!--<tr>
+	<tr>
 	  <td>Autoinstall#slurp
 #filter None
@@ -92,5 +82,5 @@
 #end filter
 	  </input>
-	</tr>-->
+	</tr>
 	<tr>
 	  <td>Boot CD</td>
Index: trunk/packages/sipb-xen-www/code/validation.py
===================================================================
--- trunk/packages/sipb-xen-www/code/validation.py	(revision 628)
+++ trunk/packages/sipb-xen-www/code/validation.py	(revision 629)
@@ -5,5 +5,5 @@
 import re
 import string
-from sipb_xen_database import Machine, NIC, Type, Disk, CDROM
+from sipb_xen_database import Machine, NIC, Type, Disk, CDROM, Autoinstall
 from webcommon import InvalidInput
 
@@ -20,5 +20,5 @@
     def __init__(self, username, state, machine_id=None, name=None, description=None, owner=None,
                  admin=None, contact=None, memory=None, disksize=None,
-                 vmtype=None, cdrom=None, clone_from=None, strict=False):
+                 vmtype=None, cdrom=None, autoinstall=None, strict=False):
         # XXX Successive quota checks aren't a good idea, since you
         # can't necessarily change the locker and disk size at the
@@ -66,8 +66,6 @@
                 raise CodeError("Invalid cdrom type '%s'" % cdrom)
             self.cdrom = cdrom
-        if clone_from is not None:
-            if clone_from not in ('ice3', ):
-                raise CodeError("Invalid clone image '%s'" % clone_from)
-            self.clone_from = clone_from
+        if autoinstall is not None:
+            self.autoinstall = Autoinstall.get(autoinstall)
 
 
