3 from sipb_xen_database import *
6 from subprocess import call
8 connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
11 for d in Disk.select():
12 machine = Machine.get(d.machine_id)
13 lvname = machine.name + "_" + d.guest_device_name
14 if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
16 print >>sys.stderr, "Creating LV %s..." % (lvname,)
17 rv = call(["lvcreate", "-L", str(d.size) + "M", "-n", lvname, vg])
19 print >>sys.stderr, "Error creating LV %s\n" %(lvname,)