source: trunk/packages/sipb-xen-database/sipb-xen-database/conf.py @ 24

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 
1import sipb_xen_database.models as models
2
3# `name' gets passed in from the xm create call
4
5machine = models.Machine.get_by(name=name)
6
7
8memory = machine.memory
9maxmem = memory
10name = machine.name
11uuid = machine.uuid
12
13vcpus = machine.cpus
14
15# XXX TODO deal with vifs
16
17disk = []
18
19for d in machine.disks:
20    dspec = 'phy:xenvg/%s,%s,w' % (???, d.guest_device_name)
21    disk.append(dspec)
22
23restart = 'destroy'
24if machine.autorestart:
25    restart = 'restart'
26
27on_poweroff = 'destroy'
28on_reboot = 'restart'
29on_crash = restart
Note: See TracBrowser for help on using the repository browser.