disk_size = validation.validDisk(owner, disk_size)
vm_type = fields.getfirst('vmtype')
- if vm_type not in ('hvm', 'paravm'):
- raise CodeError("Invalid vm type '%s'" % vm_type)
- is_hvm = (vm_type == 'hvm')
+ vm_type = validation.validVmType(vm_type)
cdrom = fields.getfirst('cdrom')
if cdrom is not None and not CDROM.get(cdrom):
raise CodeError("Invalid clone image '%s'" % clone_from)
return dict(contact=user, name=name, memory=memory, disk_size=disk_size,
- owner=owner, is_hvm=is_hvm, cdrom=cdrom, clone_from=clone_from)
+ owner=owner, machine_type=vm_type, cdrom=cdrom, clone_from=clone_from)
def create(user, fields):
"""Handler for create requests."""