|
Last change
on this file since 103 was
102,
checked in by nelhage, 18 years ago
|
|
v6, with a script to autocreate any new logical volumes
|
-
Property svn:executable set to
*
|
|
File size:
609 bytes
|
| Line | |
|---|
| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | from sipb_xen_database import * |
|---|
| 4 | import sys |
|---|
| 5 | import os.path |
|---|
| 6 | from subprocess import call |
|---|
| 7 | |
|---|
| 8 | connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen') |
|---|
| 9 | |
|---|
| 10 | vg = "xenvg" |
|---|
| 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)): |
|---|
| 15 | # LV doesn't exist |
|---|
| 16 | print >>sys.stderr, "Creating LV %s..." % (lvname,) |
|---|
| 17 | rv = call(["lvcreate", "-L", str(d.size) + "M", "-n", lvname, vg]) |
|---|
| 18 | if rv != 0: |
|---|
| 19 | print >>sys.stderr, "Error creating LV %s\n" %(lvname,) |
|---|
Note: See
TracBrowser
for help on using the repository browser.