From: Nelson Elhage <nelhage@mit.edu>
Date: Sun, 15 Jul 2007 21:26:22 +0000 (-0400)
Subject: An uncomplete prototype of a xen conf file that pulls from the database
X-Git-Tag: sipb-xen-database/1~8
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/commitdiff_plain/cfa1e6d3ec32474c0c6e5e4f62bc1393ee7386d3

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
---

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