From cfa1e6d3ec32474c0c6e5e4f62bc1393ee7386d3 Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Sun, 15 Jul 2007 17:26:22 -0400 Subject: [PATCH] An uncomplete prototype of a xen conf file that pulls from the database svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=24 --- conf.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 conf.py diff --git a/conf.py b/conf.py new file mode 100644 index 0000000..c7656b6 --- /dev/null +++ b/conf.py @@ -0,0 +1,29 @@ +import sipb_xen_database.models as models + +# `name' gets passed in from the xm create call + +machine = models.Machine.get_by(name=name) + + +memory = machine.memory +maxmem = memory +name = machine.name +uuid = machine.uuid + +vcpus = machine.cpus + +# XXX TODO deal with vifs + +disk = [] + +for d in machine.disks: + dspec = 'phy:xenvg/%s,%s,w' % (???, d.guest_device_name) + disk.append(dspec) + +restart = 'destroy' +if machine.autorestart: + restart = 'restart' + +on_poweroff = 'destroy' +on_reboot = 'restart' +on_crash = restart -- 1.7.9.5