nested hardware-assisted virtualization

一.nested kvm

Configure nested KVM. It's possible to install KVM and create virtual machines as nested KVM on KVM host.

1.CentOS7

(1)Enable the setting for Nested KVM.

[root@dlp ~]# 
vi /etc/modprobe.d/kvm-nested.conf
# create new

options kvm_intel nested=1
[root@dlp ~]# 
modprobe -r kvm_intel 
# unload

[root@dlp ~]# 
modprobe kvm_intel 
# reload again

[root@dlp ~]# 
cat /sys/module/kvm_intel/parameters/nested 

Y
# just enabled

(2)Edit the configuration of a virtual machine you'd like to set nested like follows.It's OK to configure nested KVM and you can create virtual machines on the virtual machine nested.
[root@dlp ~]# 
virsh edit centos7
# edit a virtual machine "centos7"
# change like folows for "cpu mode" section

<cpu mode='
host-passthrough
'>

2.Ubuntu14.04LTS

(1)Make sure the current settings for Nested KVM and change it if needed.
# show the current setting ( if the result is "Y", it's OK )

root@dlp:~# 
cat /sys/module/kvm_intel/parameters/nested 

Y
# if the result is "N", change like follows and reboot the system )

[root@dlp ~]# 
echo 'options kvm_intel nested=1' >> /etc/modprobe.d/qemu-system-x86.conf
(2)Make sure the CPU model on your computer.
[root@dlp ~]# 
virsh capabilities | egrep "/model|/vendor" 

<model>Westmere</model>
# CPU model

<vendor>Intel</vendor>
# CPU vendor

<model>apparmor</model>
<model>dac</model>
(3) Edit the configuration of a virtual machine you'd like to nest like follows. It's OK to configure nested KVM and you can create virtual machines on the virtual machine nested.
[root@dlp ~]# 
virsh edit www
# edit a virtual machine "www"
# add following lines

<cpu mode='custom' match='exact'>
  
# CPU model

  <model fallback='allow'>Westmere</model>
  
# CPU vendor

  <vendor>Intel</vendor>
  <feature policy='require' name='vmx'/>
</cpu>

二.Vmware Virtualized HV

Most hypervisors require hardware-assisted virtualization (HV). VMware products require hardware-assisted virtualization for 64-bit guests on Intel hardware. When running as a guest hypervisor, VMware products also require hardware-assisted virtualization for 64-bit guests on AMD hardware.  The hardware-assisted virtualization features of the physical CPU are not typically available in a VM, because most hypervisors (from VMware or others) do not virtualize HV. However, Workstation 8, Player 4, Fusion 4, and ESXi 5.0 (or later) offer virtualized HV, so that you can run guest hypervisors which require hardware-assisted virtualization.

 

With virtualized HV enabled for the outer guest, you should be able to run any guest hypervisor that requires hardware-assisted virtualization. In particular, this means that you will be able to run 64-bit nested guests under VMware guest hypervisors. 

ESXi 6.0

Virtualized HV is fully supported for virtual hardware version 9 or later VMs on hosts that support  Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, use the web client and navigate to the processor settings screen. Check the  box next to  "Expose hardware-assisted virtualization to the guest operating system."  This setting is not available under the traditional C# client.

Workstation 11 / Player 7 / Fusion 7

Virtualized HV is fully supported for virtual hardware version 9 or later VMs on hosts that support Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, select VM->Settings and navigate to the processor settings screen. Check the box next to  "Virtualize Intel VT-x/EPT or AMD-V/RVI."

Workstation 10 / Player 6 / Fusion 6

Virtualized HV is fully supported for virtual hardware version 9 or 10 VMs on hosts that support Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, select VM->Settings and navigate to the processor settings screen. Check the box next to  "Virtualize Intel VT-x/EPT or AMD-V/RVI."

ESXi 5.5

Virtualized HV is fully supported for virtual hardware version 9 or 10 VMs on hosts that support  Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, use the web client and navigate to the processor settings screen. Check the  box next to  "Expose hardware-assisted virtualization to the guest operating system."  This setting is not available under the traditional C# client.

Workstation 9 / Player 5 / Fusion 5

Virtualized HV is fully supported for virtual hardware version 9 VMs on hosts that support Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, select VM->Settings and navigate to the processor settings screen. Check the box next to  "Virtualize Intel VT-x/EPT or AMD-V/RVI."

ESXi 5.1

Virtualized HV is fully supported for virtual hardware version 9 VMs on hosts that support  Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, use the web client and navigate to the processor settings screen. Check the  box next to  "Expose hardware-assisted virtualization to the guest operating system."  This setting is not available under the traditional C# client.

Workstation 8 / Player 4

Virtualized HV is available for virtual hardware version 8 VMs on hosts that support Intel VT-x and EPT or AMD-V and RVI. To enable virtualized HV, select VM->Settings and navigate to the processor settings screen. Check the box next to "Virtualize Intel VT-x/EPT or AMD-V/RVI."  You will see a warning that virtualized HV will make this VM incompatible with other VMware products. In particular, if this VM is moved to an ESXi 5.0 host, virtualized HV will not be available without additional tweaking.

Fusion 4

Virtualized HV is available for virtual hardware version 8 VMs on hosts that support Intel VT-x and EPT or AMD-V and RVI, but it cannot be selected through the user interface. To enable virtualized HV, edit the outer guest's configuration file by hand and add the following line:

vhv.enable = TRUE

ESXi 5.0

On ESXi 5.0, virtualized HV is prohibited by default. This feature is used internally within VMware for testing purposes, but it is not recommended for production systems. It is available on hosts that support Intel VT-x or AMD-V, but it is not recommended for systems without second level address translation (EPT or RVI), because of its poor performance without SLAT. Unfortunately, this feature does not work on AMD "Bulldozer" CPUs running ESXi 5.0.

 

To allow the use of this feature, the ESXi administrator must add the following configuration option to the /etc/vmware/config file on the physical host:

vhv.allow = TRUE

Once allowed by the ESXi administrator, virtualized HV will be enabled by default for all hardware version 8 VMs with guest OS type "ESX Server 4" and "ESX Server 5." To enable virtualized HV for other guests, add the following lines to the outer guest's configuration file:

cpuid.1.ecx="----:----:----:----:----:----:--h-:----"
cpuid.80000001.ecx.amd="----:----:----:----:----:----:----:-h--"
cpuid.8000000a.eax.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"
cpuid.8000000a.ebx.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"
cpuid.8000000a.edx.amd="hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh"

references:http://www.server-world.info/en/note?os=CentOS_7&p=kvm&f=7
  http://www.server-world.info/en/note?os=Ubuntu_14.04&p=kvm&f=8
  https://communities.vmware.com/docs/DOC-8970

`nested-draggable` 是 `vuedraggable` 库提供的一个嵌套拖拽组件,可以用于实现多层级嵌套的拖拽排序功能。 使用 `nested-draggable`,需要先安装 `vuedraggable` 库: ``` npm install vuedraggable --save ``` 然后在需要使用 `nested-draggable` 的组件中,引入 `vuedraggable` 和 `nested-draggable` 组件: ```vue <template> <div> <nested-draggable v-model="list" :options="draggableOptions" class="list"> <template #default="{ element }"> <div :class="[element.type === 'folder' ? 'folder' : 'item']"> <div class="drag-handle"></div> <div class="content"> <div>{{ element.name }}</div> <div v-if="element.children"> <nested-draggable :list="element.children" :options="draggableOptions" class="sublist"></nested-draggable> </div> </div> </div> </template> </nested-draggable> </div> </template> <script> import draggable from 'vuedraggable' import nestedDraggable from 'vuedraggable/dist/vuedraggable.nested' export default { components: { draggable, nestedDraggable }, data () { return { list: [ { type: 'folder', name: 'Folder 1', children: [ { type: 'item', name: 'Item 1' }, { type: 'item', name: 'Item 2' } ] }, { type: 'folder', name: 'Folder 2', children: [ { type: 'item', name: 'Item 3' } ] } ], draggableOptions: { group: 'items', animation: 150, handle: '.drag-handle', ghostClass: 'ghost', chosenClass: 'chosen' } } } } </script> <style> .list { display: flex; flex-direction: column; padding-left: 20px; } .item { display: flex; align-items: center; padding: 10px; border: 1px solid #ccc; } .folder { border: 1px solid #ccc; margin-bottom: 10px; padding: 10px; } .drag-handle { width: 20px; height: 20px; margin-right: 10px; background-color: #ccc; cursor: move; } .chosen { outline: 2px dashed #ccc; } </style> ``` 在以上代码中,我们采用了 `nested-draggable` 组件实现了多层级嵌套的拖拽排序功能。在 `nested-draggable` 组件中,我们绑定了 `list` 数组作为拖拽列表,设置了拖拽配置项 `draggableOptions`,并通过插槽自定义了拖拽元素的展示方式。 需要注意的是,`nested-draggable` 中嵌套的 `nested-draggable` 组件需要绑定子列表的数据,并设置对应的拖拽配置项。在样式方面,我们通过 CSS 对拖拽元素和容器进行了样式的设置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值