An uncomplete prototype of a xen conf file that pulls from the database
authorNelson Elhage <nelhage@mit.edu>
Sun, 15 Jul 2007 21:26:22 +0000 (17:26 -0400)
committerNelson Elhage <nelhage@mit.edu>
Sun, 15 Jul 2007 21:26:22 +0000 (17:26 -0400)
svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=24

conf.py [new file with mode: 0644]

diff --git a/conf.py b/conf.py
new file mode 100644 (file)
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