boot_disk = (instance.hvparams[constants.HV_BOOT_ORDER] == "disk")
boot_cdrom = (instance.hvparams[constants.HV_BOOT_ORDER] == "cdrom")
+ boot_network = (instance.hvparams[constants.HV_BOOT_ORDER] == "network")
+
+ if boot_network:
+ kvm_cmd.extend(['-boot', 'n'])
disk_type = instance.hvparams[constants.HV_DISK_TYPE]
if disk_type == constants.HT_DISK_PARAVIRTUAL:
if boot_disk:
kvm_cmd.extend(['-boot', 'c'])
boot_val = ',boot=on'
+ # We only boot from the first disk
boot_disk = False
else:
boot_val = ''
" an absolute path, if defined")
boot_order = hvparams[constants.HV_BOOT_ORDER]
- if boot_order not in ('cdrom', 'disk'):
- raise errors.HypervisorError("The boot order must be 'cdrom' or 'disk'")
+ if boot_order not in ('cdrom', 'disk', 'network'):
+ raise errors.HypervisorError("The boot order must be 'cdrom', 'disk' or"
+ " 'network'")
if boot_order == 'cdrom' and not iso_path:
raise errors.HypervisorError("Cannot boot from cdrom without an ISO path")
" hypervisor. Please choose one of: %s" %
(nic_type,
constants.HT_KVM_VALID_NIC_TYPES))
+ elif boot_order == 'network' and nic_type == constants.HT_NIC_PARAVIRTUAL:
+ raise errors.HypervisorError("Cannot boot from a paravirtual NIC. Please"
+ " change the nic type.")
disk_type = hvparams[constants.HV_DISK_TYPE]
if disk_type not in constants.HT_KVM_VALID_DISK_TYPES: