Nested KVM Hypervisor Support

2 篇文章 0 订阅

​​​​​​​Description

Nested KVM是指基于虚拟化技术的虚拟机管理系统。

Nested KVM在Intel处理器上,KVM使用Intel的vmx(virtualmachine eXtensions)来提高虚拟机性能,即硬件辅助虚拟化技术。如果一台虚拟机能够和物理机一样支持vmx,那么就可以在这台虚拟机上再次安装虚拟机。Nested KVM是一个可通过内核参数来启用的功能,它能够使一台虚拟机具有物理CPU特性,支持vmx或者svm(AMD)硬件虚拟化。

See

  • hypervisor-kvm
  • How to Enable Nested KVM Virtualization
  • Nested KVM Hypervisor Support

Official

Checking Whether Nested Virtualization is Enabled

  • Support nested:Kernel version at least 3.X
modinfo kvm_intel | grep nested
parm: nested:bool
systool -m kvm_intel -v   | grep -i nested
nested              = "N"
# or
cat /sys/module/kvm_intel/parameters/nested
Y (Y for yes) or N (N for no)

Enabling Nested Virtualization

  • Tested
# cat /etc/modprobe.d/kvm.conf
# To enable nesting, simply add or change the nested parameter so it has 1 as its value
# For Intel
options kvm_intel nested=1
# For AMD
# options kvm_amd nested=1




# Unload and reload kvm-intel kernel module with nested support.
# Unload the module
$ sudo modprobe -r kvm_intel


# Reload the module with new settings
$ sudo modprobe kvm_intel




# command setting
modprobe kvm-intel nested=1
  • Not Test
# Modify grub.cfg
# Add kvm-intel.nested=1 to the end of the row of quiet in the kernel parameter
# grep quiet /boot/grub2/grub.cfg
        linux16 /vmlinuz-3.10.0-862.el7.x86_64 root=UUID=8c936eea-af89-48bd-83cb-b5d9cdb440e8 ro crashkernel=auto rhgb quiet kvm-intel.nested=1 LANG=zh_CN.UTF-8

Activating Nested Virtualization For a Guest

  • Tested
# virsh edit virtualhost-name
# Define the CPU mode :"core2duo", And add the "vmx" feature to the virtual machine
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
    <feature policy='require' name='vmx'/>
  </cpu>
  • Not Test
<cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
# or
# host-passthrough: 
# Advantages: The vcpu of the virtual machine is the same as that of the physical machine
# Disadvantages: The cpus of the two servers must be the same during VM migration; otherwise, the migration fails.
 <cpu mode='host-passthrough'>
    <topology sockets='2' cores='2' threads='2'/>
  </cpu>
  <cpu>
    <topology sockets='8' cores='1' threads='1'/>
  </cpu>


# command start virtualhost, Add Option.
-enable-kvm -cpu qemu64,+vmx

Checking a Guest Can Nested

# start virtualhost
lscpu | grep -P "vmx"

分享、在看与点赞
只要你点,我们就是胖友

来自: Nested KVM Hypervisor Supporticon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=Mzk0NTQ3OTk3MQ==&mid=2247487423&idx=1&sn=5fd512154aebf450112be6f62f18195d&chksm=c31587f3f4620ee5341ef3e16e9f43cfa0d6d85e10fc6f61c253c595acbedc8a4a2696d95fb0&token=355315523&lang=zh_CN#rd

  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Linux技术宅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值