1 import sipb_xen_database.models as models
3 # `name' gets passed in from the xm create call
5 machine = models.Machine.get_by(name=name)
6 machine_type = models.Type.get_by(type_id=machine.type_id)
8 memory = machine.memory
20 viftype = "type=ioemu"
25 device_model = 'qemu-dm'
27 kernel = '/boot/vmlinuz-2.6.18-4-xen-amd64'
28 ramdisk = '/boot/initrd.img-2.6.18-4-xen-amd64'
31 pae = machine_type.pae
32 acpi = machine_type.acpi
33 apic = machine_type.apic
37 for n in machine.nics:
38 d = '%s, mac=%s, ip=%s, bridge=xenbr0' % (viftype, n.mac_addr, n.ip)
43 for d in machine.disks:
44 device = 'xenvg/' + machine.name + '_' + d.guest_device_name
45 dspec = 'phy:%s,%s%s,w' % (device, diskioemu, d.guest_device_name)
49 if machine.autorestart:
52 on_poweroff = 'destroy'