更改QEMU-KVM虚拟机的引导设备

我正在尝试更改VM的引导设备。 我在/etc/libvirt/qemu VM的XML文件,并设置<boot dev='cdrom' /> 。 不过,它试图从硬盘而不是从光盘启动。

我知道我有一个加载在CD-ROM虚拟设备上的ISO映像。

我不正确吗? 我试图彻底closures虚拟机,并启动它无济于事。 也许我需要重新加载设置?

编辑:

根据@Selivanov的要求:

 $ libvirtd --version libvirtd (libvirt) 0.8.7 

和XML文件:

 <domain type='kvm'> <name>nimmy.example.com</name> <uuid>(SNIP)</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='rhel6.1.0'>hvm</type> <boot dev='cdrom'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/nimmy.img'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/nimmy/CentOS-6.0-x86_64-netinstall.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='network'> <mac address='(SNIP)'/> <source network='default'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='cirrus' vram='9216' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> </domain> 

如果libvirt没有在启动/停止时重新加载虚拟机设置, virsh edit命令可能会有所帮助。 请写出完整的XML文件和libvirt版本

嗯…一切似乎都OK。 尝试添加

 <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'/> 

到<os>部分,看看cdrom是否出现在启动菜单中。 也可以尝试从<os>中删除所有<boot>logging并添加

 <boot order='1'/> 

到<磁盘>部分

如果虚拟机已closures,请在/ var / lib / libvirt / qemu / save下查找已存储的已保存映像 – 尽pipe通过virsh编辑进行了更改,但仍会保留旧参数。 我在一个类似的情况下删除了这样的图像,它一直在寻找一个不存在的networking接口(因此无法启动)。