背景:
今天愤怒的把迁移的坑都填上了,现在有空了记录下来,并且整理一下思路吧,还有一些不清晰的地方。
kvm是compute默认的hypervisor, 我的环境里也用的是kvm。
问题:
bug:https://bugs.launchpad.net/nova/+bug/1392773
这帮人review我的代码的时候总要test,这里怎么就会没有test就。。还是stable release--
参照patch把代码改好后,重启服务。。又是个坑:
说是cpu feature的问题,幸好以前研究过,记得这个坑,不过应该已经修复了(大概意思是Windows对cpu的topology(sockets/cores/threads)要求比较严格,经常会出现分给它4个cpu只显示1个这种情况)。然后重新来研究了一下。
0.在两个compute节点: cat /proc/cpuinfo
发现我擦!真的不一样,虽然都是Intel的。。然后还和装环境的同学确认了一下。。
1.然后在分别:cat /usr/share/libvirt/cpu_map.xml
这里面是libvirt KVM driver 定义的一些 model,找出来一个两边都支持的,比如“haswell”(。。。。当然那个旧的服务器应该不支持它,我忘了我用的那个的名字了,就用它代替了)
2.edit /etc/nova/nova.conf
加入关于libvirt的配置:
[libvirt]
cpu_mode = custom
cpu_model = Nehalem
原文直接拿过来吧:
If your nova.conf
file contains cpu_mode=host-model
, libvirt identifies the CPU model in /usr/share/libvirt/cpu_map.xml
file that most closely matches the host, and requests additional CPU flags to complete the match. This configuration provides the maximum functionality and performance and maintains good reliability and compatibility if the guest is migrated to another host with slightly different host CPUs.