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
