--- /dev/null
+#!/usr/bin/env python
+
+from sipb_xen_database import *
+import sys
+import os.path
+from subprocess import call
+
+connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+
+vg = "xenvg"
+for d in Disk.select():
+ machine = Machine.get(d.machine_id)
+ lvname = machine.name + "_" + d.guest_device_name
+ if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
+ # LV doesn't exist
+ print >>sys.stderr, "Creating LV %s..." % (lvname,)
+ rv = call(["lvcreate", "-L", str(d.size) + "M", "-n", lvname, vg])
+ if rv != 0:
+ print >>sys.stderr, "Error creating LV %s\n" %(lvname,)
+sipb-xen-database (6) unstable; urgency=low
+
+ * Adding a script to create lvm volumes
+
+ -- Nelson Elhage <nelhage@mit.edu> Sat, 22 Sep 2007 13:59:36 -0400
+
sipb-xen-database (5) unstable; urgency=low
* Change the host from sipb-vm-1 to sipb-xen-dev