KVM启动虚拟机CPU报错,之前已经写过日志,这里说的是如果你实在找不到对应的CPU架构,那就直接选择”host-model”
比如,我之前的配置文件,cpu对应的配置如下:
<cpu mode='custom' match='exact' check='partial'> <model fallback='allow'>Skylake-Client</model> <feature policy='require' name='md-clear'/> <feature policy='require' name='spec-ctrl'/> <feature policy='require' name='ssbd'/> </cpu>
这个配置是我创建模板机默认的,现在我把其中一台虚拟机迁移到另外一台主机就报错了
the CPU is incompatible with host CPU: Host CPU does not provide required features: x2apic, hle, rtm, mpx, rdseed, adx, smap, xsavec, xgetbv1, 3dnowprefetch
那我又不想去查微代码,那就直接改成复制主机模式吧,更改如下:
<cpu mode='host-model' check='partial'> <model fallback='allow'/> </cpu>
这一类报错网上有很多说明,我贴一个:
https://bugzilla.redhat.com/show_bug.cgi?id=1609818
重点是最后几位小哥的建议:
Daniel Berrangé 2018-07-30 15:03:30 UTC
Ok, I noticed just now that I have that CPU param, not sure where it came from I was just confused since it worked on different kernel. So if anyone hits this issue all you have to do is: 1.Open virt-manager 2.Go to parameters of VM 3.Go to cpu section 4.Check "Copy host CPU configuration" and click Apply that fixed the problem for me thanks a lot Daniel
The virt-install way would be to add '--cpu host', or at least it worked for me.