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