Index: trunk/packages/invirt-web/code/controls.py
===================================================================
--- trunk/packages/invirt-web/code/controls.py	(revision 2019)
+++ trunk/packages/invirt-web/code/controls.py	(revision 2020)
@@ -111,9 +111,13 @@
         raise
     makeDisks(machine)
-    if autoinstall:
-        lvinstall(machine, autoinstall)
-    else:
-        # tell it to boot with cdrom
-        bootMachine(machine, cdrom)
+    try:
+        if autoinstall:
+            lvinstall(machine, autoinstall)
+        else:
+            # tell it to boot with cdrom
+            bootMachine(machine, cdrom)
+    except CodeError, e:
+        deleteVM(machine)
+        raise
     return machine
 
