在guest虚拟机中使用多个virtio磁盘更改KVM启动顺序

我刚刚开始玩KVM,所以在这里学习很多。 我有一个客户正在运行,终于用我想要的Virtio SCSI和networking驱动程序(Win2k3)的操作系统安装程序,我很高兴与一切。 然后closures系统,并添加第二个数据卷作为Virtio。 一旦我这样做,它将我原来的“目标设备”从“VirtIO Disk 1”升级到“VirtIO disk 2”,现在除非手动F12并select(现在是第二个)磁盘,否则它将不会启动。 为什么当我第一个添加的时候,我的原始磁盘是第二个呢? 更重要的是,我该如何重新排列呢? 也许只是删除它们,并以相反的顺序将它们添加回来? 似乎应该有一个configuration选项或XML文件中的编辑。

我没有尝试编辑vmname.xml文件,并find了选项。 我按照我预先给定的顺序将它添加到每个磁盘设备,但是它总是无法启动。 就像它只会尝试第一个硬盘并停在那里。 而且它似乎忽略了XMlconfiguration中的引导顺序参数。

我会继续前进,现在删除并重新添加,但我很好奇,不应该这是一个可configuration的,没有删除设备?

我正在运行Ubuntu 14.04,它相当新的。 我认为libvirtd是1.2.2。 任何其他可能的帮助,只是让我知道。 谢谢您的帮助! 格雷格

快速更新:我试图删除两个磁盘,closuresvirt-manager,然后重新打开。 然后,我先添加datavol,然后添加OSVolume(应该是第一个磁盘),它确实坚持保持倒序! 它没有工作。

如果磁盘顺序倒退,如何让客人启动? (无需手动启动到F12选项)

[编辑:客人的virsh dumpxml]

我看到引导顺序标签现在虽然删除,因为我重新添加磁盘。 我想这个磁盘是第一个: /dev/zvol/dpool/vm/kvm/disk/alinos/osvol

 <domain type='kvm' id='80'> <name>alinos</name> <uuid>a161efe4-245a-953b-89e3-04fa3b914f79</uuid> <memory unit='KiB'>3145728</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='i686' machine='pc-i440fx-trusty'>hvm</type> <boot dev='hd'/> <bootmenu enable='yes'/> </os> <features> <acpi/> <apic/> <pae/> </features> <cpu mode='custom' match='exact'> <model fallback='allow'>SandyBridge</model> <vendor>Intel</vendor> <feature policy='require' name='vme'/> <feature policy='require' name='dtes64'/> <feature policy='require' name='vmx'/> <feature policy='require' name='erms'/> <feature policy='require' name='xtpr'/> <feature policy='require' name='smep'/> <feature policy='require' name='pcid'/> <feature policy='require' name='est'/> <feature policy='require' name='monitor'/> <feature policy='require' name='smx'/> <feature policy='require' name='tm'/> <feature policy='require' name='acpi'/> <feature policy='require' name='osxsave'/> <feature policy='require' name='ht'/> <feature policy='require' name='pdcm'/> <feature policy='require' name='fsgsbase'/> <feature policy='require' name='f16c'/> <feature policy='require' name='ds'/> <feature policy='require' name='tm2'/> <feature policy='require' name='ss'/> <feature policy='require' name='pbe'/> <feature policy='require' name='ds_cpl'/> <feature policy='require' name='rdrand'/> </cpu> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm-spice</emulator> <disk type='file' device='cdrom'> <driver name='qemu' type='raw' cache='none'/> <target dev='hdc' bus='ide' tray='open'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> <disk type='file' device='floppy'> <driver name='qemu' type='raw' cache='none'/> <target dev='fda' bus='fdc'/> <alias name='fdc0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/zvol/dpool/vm/kvm/disk/alinos/datavol'/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/zvol/dpool/vm/kvm/disk/alinos/osvol'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> <controller type='pci' index='0' model='pci-root'> <alias name='pci.0'/> </controller> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='fdc' index='0'> <alias name='fdc0'/> </controller> <controller type='scsi' index='0'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> <controller type='usb' index='0' model='ich9-ehci1'> <alias name='usb0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <alias name='usb0'/> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <alias name='usb0'/> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <alias name='usb0'/> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/> </controller> <interface type='bridge'> <mac address='52:54:00:89:65:18'/> <source bridge='br0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> <model type='vmvga' vram='9216' heads='1'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> <seclabel type='none'/> </domain> 

将所需磁盘设置为virtio-disk0,目标为/ dev / vda。 磁盘出现在XML中的顺序也很重要,所以请确保操作系统磁盘先到达

如果您有多个硬盘,则可以使用更好的解决scheme

 <boot order='1'/> 

为您要启动的第一个设备

 <boot order='2'/> 

第二等你把这个到你想要启动的每个设备。 我做了我的设备configuration的最后一行。

我的磁盘是不同的types,所以我需要使用引导顺序configuration。

它不适用于只更改磁盘名称,例如虚拟磁盘和硬盘驱动器分区。

你也必须删除

 <boot dev='hd'/> 

从操作系统部分