Last change
on this file since 24 was
24,
checked in by nelhage, 17 years ago
|
An uncomplete prototype of a xen conf file that pulls from the database
|
File size:
521 bytes
|
Line | |
---|
1 | import sipb_xen_database.models as models |
---|
2 | |
---|
3 | # `name' gets passed in from the xm create call |
---|
4 | |
---|
5 | machine = models.Machine.get_by(name=name) |
---|
6 | |
---|
7 | |
---|
8 | memory = machine.memory |
---|
9 | maxmem = memory |
---|
10 | name = machine.name |
---|
11 | uuid = machine.uuid |
---|
12 | |
---|
13 | vcpus = machine.cpus |
---|
14 | |
---|
15 | # XXX TODO deal with vifs |
---|
16 | |
---|
17 | disk = [] |
---|
18 | |
---|
19 | for d in machine.disks: |
---|
20 | dspec = 'phy:xenvg/%s,%s,w' % (???, d.guest_device_name) |
---|
21 | disk.append(dspec) |
---|
22 | |
---|
23 | restart = 'destroy' |
---|
24 | if machine.autorestart: |
---|
25 | restart = 'restart' |
---|
26 | |
---|
27 | on_poweroff = 'destroy' |
---|
28 | on_reboot = 'restart' |
---|
29 | on_crash = restart |
---|
Note: See
TracBrowser
for help on using the repository browser.