3 from sipb_xen_database import *
6 from subprocess import call
9 connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
16 for d in Disk.select():
17 check(re.match('^[A-Za-z0-9]+$', d.guest_device_name))
18 machine = Machine.get(d.machine_id)
19 check(re.match('^[A-Za-z0-9][A-Za-z0-9._-]*$', machine.name))
20 lvname = machine.name + "_" + d.guest_device_name
21 if not os.path.exists("/dev/%s/%s" % (vg, lvname)):
23 print >>sys.stderr, "Creating LV %s..." % (lvname,)
24 rv = call(["lvcreate", "-L", str(d.size) + "M", "-n", lvname, vg])
26 print >>sys.stderr, "Error creating LV %s\n" %(lvname,)