Revision 8745c3d7
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
236 | 236 |
|
237 | 237 |
boot_disk = (instance.hvparams[constants.HV_BOOT_ORDER] == "disk") |
238 | 238 |
boot_cdrom = (instance.hvparams[constants.HV_BOOT_ORDER] == "cdrom") |
239 |
boot_network = (instance.hvparams[constants.HV_BOOT_ORDER] == "network") |
|
240 |
|
|
241 |
if boot_network: |
|
242 |
kvm_cmd.extend(['-boot', 'n']) |
|
239 | 243 |
|
240 | 244 |
disk_type = instance.hvparams[constants.HV_DISK_TYPE] |
241 | 245 |
if disk_type == constants.HT_DISK_PARAVIRTUAL: |
... | ... | |
250 | 254 |
if boot_disk: |
251 | 255 |
kvm_cmd.extend(['-boot', 'c']) |
252 | 256 |
boot_val = ',boot=on' |
257 |
# We only boot from the first disk |
|
253 | 258 |
boot_disk = False |
254 | 259 |
else: |
255 | 260 |
boot_val = '' |
... | ... | |
755 | 760 |
" an absolute path, if defined") |
756 | 761 |
|
757 | 762 |
boot_order = hvparams[constants.HV_BOOT_ORDER] |
758 |
if boot_order not in ('cdrom', 'disk'): |
|
759 |
raise errors.HypervisorError("The boot order must be 'cdrom' or 'disk'") |
|
763 |
if boot_order not in ('cdrom', 'disk', 'network'): |
|
764 |
raise errors.HypervisorError("The boot order must be 'cdrom', 'disk' or" |
|
765 |
" 'network'") |
|
760 | 766 |
|
761 | 767 |
if boot_order == 'cdrom' and not iso_path: |
762 | 768 |
raise errors.HypervisorError("Cannot boot from cdrom without an ISO path") |
... | ... | |
767 | 773 |
" hypervisor. Please choose one of: %s" % |
768 | 774 |
(nic_type, |
769 | 775 |
constants.HT_KVM_VALID_NIC_TYPES)) |
776 |
elif boot_order == 'network' and nic_type == constants.HT_NIC_PARAVIRTUAL: |
|
777 |
raise errors.HypervisorError("Cannot boot from a paravirtual NIC. Please" |
|
778 |
" change the nic type.") |
|
770 | 779 |
|
771 | 780 |
disk_type = hvparams[constants.HV_DISK_TYPE] |
772 | 781 |
if disk_type not in constants.HT_KVM_VALID_DISK_TYPES: |
Also available in: Unified diff