KVM:主机重新启动后机器无法启动

我发现我的KVM客人在我重新启动我的主机后无法使用。 具体来说,我总是得到这个错误:

从硬盘启动

启动失败:不是可启动的磁盘

什么原因导致这个错误 我已经试过在qcow2和raw之间切换VM磁盘types,因为在线的一些文章提到,如果virt不知道要加载的映像types,可能会发生这种情况,但这并没有帮助。

**一些更多的细节**

我使用一个像这样的命令从源创build我的虚拟机:

base="http://mirror.pnl.gov/fedora/linux/releases/20/Fedora/x86_64/os/" nohup sudo virt-install --hvm --name $vm_name$i --ram 4000 \ --disk path=/VirtualMachines/$vm_name$i,size=30 \ --location $base -x "ks=http://xxx.os21.ks$kx"& 

我的virsh文件看起来像这样:

  1 <domain type='kvm'> 2 <name>testFriApr11092714EDT2014_1</name> 3 <uuid>d4c86892-fb15-04ed-f4ab-7e3c76974ffc</uuid> 4 <memory unit='KiB'>4096000</memory> 5 <currentMemory unit='KiB'>4096000</currentMemory> 6 <vcpu placement='static'>1</vcpu> 7 <os> 8 <type arch='x86_64' machine='rhel6.4.0'>hvm</type> 9 <boot dev='hd'/> 10 </os> 11 <features> 12 <acpi/> 13 <apic/> 14 <pae/> 15 </features> 16 <clock offset='utc'/> 17 <on_poweroff>destroy</on_poweroff> 18 <on_reboot>restart</on_reboot> 19 <on_crash>restart</on_crash> 20 <devices> 21 <emulator>/usr/libexec/qemu-kvm</emulator> 22 <disk type='file' device='disk'> 23 <driver name='qemu' type='raw' cache='none'/> 24 <source file='/VirtualMachines/testFriApr11092714EDT2014_1'/> 25 <target dev='hda' bus='ide'/> 26 <address type='drive' controller='0' bus='0' target='0' unit='0'/> 27 </disk> 28 <controller type='usb' index='0'> 29 <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> 30 </controller> 31 <controller type='ide' index='0'> 32 <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> 33 </controller> 34 <interface type='network'> 35 <mac address='52:54:00:81:bd:fe'/> 36 <source network='default'/> 

错误提示启动盘未find或不包含有效的启动扇区。

  • 操作系统安装过程中,您是否在此磁盘上写入启动映像?
  • VM文件中指定的path是正确的磁盘映像?

我认为问题可能是以后的,注意你有:

<source file='/VirtualMachines/testFriApr11092714EDT2014_1'/>

  • /VirtualMachines/testFriApr11092714EDT2014_1是否可能不代performance有文件? ..
  • ls -l /VirtualMachines/testFriApr11092714EDT2014_1显示该文件实际存在?
  • 如果文件存在,那么KVM可能需要一个以.img(原始格式)或.qcow2(对于qcow格式)结尾的文件。

其他疑难解答步骤

  • 附加{CD,DVD} -ROM设备(通过virt-manager或virsh)
  • 启用启动菜单
  • 无法启动时从CD / DVD启动,并实际查看磁盘