Index: trunk/web/templates/main.py
===================================================================
--- trunk/web/templates/main.py	(revision 147)
+++ trunk/web/templates/main.py	(revision 152)
@@ -38,5 +38,15 @@
     pass
 
-
+class Global(object):
+    def __init__(self, user):
+        self.user = user
+
+    def __get_uptimes(self):
+        if not hasattr(self, '_uptimes'):
+            self._uptimes = getUptimes(self.machines)
+        return self._uptimes
+    uptimes = property(__get_uptimes)
+
+g = None
 
 def helppopup(subj):
@@ -73,5 +83,5 @@
     return Machine.select_by(owner=owner)
 
-def maxMemory(user, machine=None, on=None):
+def maxMemory(user, machine=None):
     """Return the maximum memory for a machine or a user.
 
@@ -84,7 +94,5 @@
 
     machines = getMachinesByOwner(user.username)
-    if on is None:
-        on = getUptimes(machines)
-    active_machines = [x for x in machines if on[x]]
+    active_machines = [x for x in machines if g.uptimes[x]]
     mem_usage = sum([x.memory for x in active_machines if x != machine])
     return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage)
@@ -96,9 +104,7 @@
     return min(MAX_DISK_SINGLE, MAX_DISK_TOTAL-disk_usage/1024.)
 
-def canAddVm(user, on=None):
+def canAddVm(user):
     machines = getMachinesByOwner(user.username)
-    if on is None:
-        on = getUptimes(machines)
-    active_machines = [x for x in machines if on[x]]
+    active_machines = [x for x in machines if g.uptimes[x]]
     return (len(machines) < MAX_VMS_TOTAL and
             len(active_machines) < MAX_VMS_ACTIVE)
@@ -160,7 +166,13 @@
     return p.stdout.read()
 
-def makeDisks():
-    """Update the lvm partitions to include all disks in the database."""
-    remctl('web', 'lvcreate')
+def lvcreate(machine, disk):
+    """Create a single disk for a machine"""
+    remctl('web', 'lvcreate', machine.name,
+           disk.guest_device_name, str(disk.size))
+    
+def makeDisks(machine):
+    """Update the lvm partitions to add a disk."""
+    for disk in machine.disks:
+        lvcreate(machine, disk)
 
 def bootMachine(machine, cdtype):
@@ -287,5 +299,5 @@
         raise
     registerMachine(machine)
-    makeDisks()
+    makeDisks(machine)
     # tell it to boot with cdrom
     bootMachine(machine, cdrom)
@@ -356,6 +368,5 @@
     on = {}
     has_vnc = {}
-    uptimes = getUptimes(machines)
-    on = uptimes
+    on = g.uptimes
     for m in machines:
         if not on[m]:
@@ -369,8 +380,8 @@
     #         on[m.name] = status is not None
     #         has_vnc[m.name] = hasVnc(status)
-    max_mem=maxMemory(user, on=on)
+    max_mem=maxMemory(user)
     max_disk=maxDisk(user)
     d = dict(user=user,
-             can_add_vm=canAddVm(user, on=on),
+             can_add_vm=canAddVm(user),
              max_mem=max_mem,
              max_disk=max_disk,
@@ -433,5 +444,10 @@
     token = base64.urlsafe_b64encode(token)
     
+    status = statusInfo(machine)
+    has_vnc = hasVnc(status)
+    
     d = dict(user=user,
+             on=status,
+             has_vnc=has_vnc,
              machine=machine,
              hostname=os.environ.get('SERVER_NAME', 'localhost'),
@@ -647,4 +663,5 @@
         email = 'moo@cow.com'
     u = User()
+    g = Global(u)
     if 'SSL_CLIENT_S_DN_Email' in os.environ:
         username = os.environ[ 'SSL_CLIENT_S_DN_Email'].split("@")[0]
Index: trunk/web/templates/vnc.tmpl
===================================================================
--- trunk/web/templates/vnc.tmpl	(revision 147)
+++ trunk/web/templates/vnc.tmpl	(revision 152)
@@ -8,4 +8,9 @@
 #def body
 <h1>Console</h1>
+#if not $on
+<p> Your machine appears to be off.</p>
+#else if not $has_vnc
+<p> Your machine appears to not be accepting VNC connections. Perhaps you have a ParaVM machine?</p>
+#end if
 <p>Here is a console to ${machine.name}.</p>
 <APPLET CODE="VncViewer.class" ARCHIVE="../VncViewer.jar"
