- 开启
nested(主机)
- 开启
nested
echo 'options kvm_intel nested=1' >/etc/modprobe.d/kvm-nested.conf- 重启
reboot- 查看
cat /sys/module/kvm_intel/parameters/nested
image.png
- 配置虚拟机(基于
libvirt)
配置(不使用)
virsh edit centos7_1
注:skylake-client特性集成到spec-ctrl特性中<cpu mode='custom' match='exact'> <model fallback='allow'>core2duo</model> <feature policy='require' name='vmx'/> <feature policy='require' name='spec-ctrl'/> </cpu> #这种方式为虚拟机定义需要模拟的CPU类型"core2duo",并且为虚拟机添加"vmx"特性 #也可以使用这种 <cpu mode='host-model'> <model fallback='allow'/> </cpu> #或者这样 <cpu mode='host-passthrough'> <topology sockets='2' cores='2' threads='2'/> </cpu> #CPU穿透,在虚拟机中看到的vcpu将会与物理机的CPU同样配置,这种方式缺点在于如果要对虚拟机迁移,迁移的目的服务器硬件配置必须与当前物理机一样
- 配置(这种情况在centos7下可以成功)
virsh edit centos7_1<cpu mode='custom' match='exact' check='partial'> <model fallback='allow'>Skylake-Client</model> <feature policy='require' name='vmx'/> </cpu>
- 通过
virt-manage配置cpu特性
image.png- 重启虚拟机
virsh destroy centos7_1
virsh start centos7_1
- 查看
vmx(虚拟机)
- 查看
vmx
cat /proc/cpuinfo |grep vmx
image.png
- 配置(基于
openstack)
引用:https://www.linuxidc.com/Linux/2015-05/117026.htm
kvm-intel 临时开启嵌套虚拟化,没用
https://www.linuxidc.com/Linux/2015-05/117026.htm
关于skylake-client:
https://mpolednik.github.io/2017/07/31/cpuflags-ovirt-hook-cpu-features/
https://fossies.org/linux/libvirt/ChangeLog


