diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 77b46b2e29c1076fe5adb370378f0e78c05dc20c..2ed07aece5d44383b49aeeae0676d939112e5bc4 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -551,10 +551,14 @@ class KVMHypervisor(hv_base.BaseHypervisor): kvm_cmd.extend(["-no-reboot"]) hvp = instance.hvparams - boot_disk = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_DISK - boot_cdrom = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_CDROM - boot_floppy = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_FLOPPY - boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK + kernel_path = hvp[constants.HV_KERNEL_PATH] + if kernel_path: + boot_disk = boot_cdrom = boot_floppy = boot_network = False + else: + boot_disk = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_DISK + boot_cdrom = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_CDROM + boot_floppy = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_FLOPPY + boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK self.ValidateParameters(hvp) @@ -645,7 +649,6 @@ class KVMHypervisor(hv_base.BaseHypervisor): drive_val = "file=%s%s" % (floppy_image, options) kvm_cmd.extend(["-drive", drive_val]) - kernel_path = hvp[constants.HV_KERNEL_PATH] if kernel_path: kvm_cmd.extend(["-kernel", kernel_path]) initrd_path = hvp[constants.HV_INITRD_PATH] diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index 5d906a40399a1bec58936ba33251b34faa492bd3..bb2d982f1ae55410d9941d926d399bed9a705a94 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -175,9 +175,11 @@ boot\_order as 'dc'. For KVM the boot order is either "floppy", "cdrom", "disk" or - "network". Please note that older versions of KVM couldn't - netboot from virtio interfaces. This has been fixed in more recent - versions and is confirmed to work at least with qemu-kvm 0.11.1. + "network". Please note that older versions of KVM couldn't netboot + from virtio interfaces. This has been fixed in more recent versions + and is confirmed to work at least with qemu-kvm 0.11.1. Also note + that if you have set the ``kernel_path`` option, that will be used + for booting, and this setting will be silently ignored. blockdev\_prefix Valid for the Xen HVM and PVM hypervisors. @@ -326,9 +328,10 @@ kernel\_path Valid for the Xen PVM and KVM hypervisors. This option specifies the path (on the node) to the kernel to boot - the instance with. Xen PVM instances always require this, while - for KVM if this option is empty, it will cause the machine to load - the kernel from its disks. + the instance with. Xen PVM instances always require this, while for + KVM if this option is empty, it will cause the machine to load the + kernel from its disks (and the boot will be done accordingly to + ``boot_order``). kernel\_args Valid for the Xen PVM and KVM hypervisors.