大网数据广告活动
服务器运维问答

libvirt cpu-mode='host-model' confuses while mapping cpu models?

· 52CE 我爱测

I have physical host which has cpu model 'Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz' and it has 'avx2' flag in cpuinfo. The host has kvm/qemu hypervisor and libvirt configured. I set cpu mode as host-model in domain XML. Guest vm…

问题原文

原帖链接 · Rohanil · CC BY-SA 3.0

I have physical host which has cpu model 'Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz' and it has 'avx2' flag in cpuinfo. The host has kvm/qemu hypervisor and libvirt configured. I set cpu mode as host-model in domain XML. Guest vm can be created on the host. When I check cpu model of guest vm, it shows as 'SandyBridge' and it also has 'avx2' flag in cpuinfo. But 'SandyBridge' does not support 'avx2' flag but 'Haswell' model does support. It is just due to host-model mode, libvirt finds nearest cpu model to 'Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz' as 'SandyBridge' but it should show 'Haswell' instead. Does that mean libvirt have a bug or it is valid representation in this scenario? I am using libvirt version 1.2.2

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

What I think is going on here is that your older version of libvirt is not aware of the fact that Intel disabled TSX in Haswell chips in a microcode update which your processor has almost certainly received by now. Libvirt only became aware of and advertised a Haswell-noTSX CPU model in version 1.2.14. Because your CPU has had some features disabled that libvirt uses for CPU type detection, it mistakenly thinks it is a SandyBridge. On a current version of libvirt, it should be correctly detected as Haswell-noTSX.

In practice, this should not really affect you at all, except for VMs being unable to use the other features introduced in Haswell and not present in SandyBridge, but you can manually add these to your VM definition XML if you can't upgrade libvirt and really want them. Keep in mind that you probably will also need to upgrade qemu. And at that point you should probably just use a more current hypervisor. Whatever you're running now is older than the hardware on which it's running, which is always a questionable idea...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。