v6, with a script to autocreate any new logical volumes sipb-xen-database/6
authorNelson Elhage <nelhage@mit.edu>
Sat, 22 Sep 2007 18:00:10 +0000 (14:00 -0400)
committerNelson Elhage <nelhage@mit.edu>
Sat, 22 Sep 2007 18:00:10 +0000 (14:00 -0400)
svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=102

client/usr/bin/sipb-xen-lvcreate [new file with mode: 0755]
debian/changelog

diff --git a/client/usr/bin/sipb-xen-lvcreate b/client/usr/bin/sipb-xen-lvcreate
new file mode 100755 (executable)
index 0000000..25c5942
--- /dev/null
@@ -0,0 +1,19 @@
+#!/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,)
index 4109170..0040868 100644 (file)
@@ -1,3 +1,9 @@
+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