Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ KVM virtualization of nested virtualization     - Build a Linux development environment under STC89C52RC (Linux)

- Additional SQL Server 5123 database reported error (Database)

- Iscsi package is installed on RHEL 6.3 x86-64 systems (Linux)

- Configuring s3c-linux-2.6.28.6-Real6410 appears Unable to find the QT3 installation (Linux)

- 11G ASM disk group does not automatically handle MOUNT (Database)

- Linux Shell Understanding and Learning (Linux)

- Can not remember how to solve the problem under Ubuntu brightness setting (Linux)

- C / C ++ language usage summary of const (Programming)

- Ubuntu 14.10 / 14.04 / 12.04 virtual users to install the printing software Boomaga (Linux)

- Linux smart small switch rfkill (Linux)

- Linux system security mechanisms to share (Linux)

- RAID configuration and management under linux (Server)

- How to convert images, audio and video formats on Ubuntu (Linux)

- Effect MongoDB plan cache (Database)

- CentOS 6.5 three ways to configure the IP address (Linux)

- ORA-00600: internal error code, arguments: [keltnfy-ldmInit], [46], [1], [], [], [], [], [] (Database)

- RedHat / CentOS ext4 partition can not be formatted large supplementary ext4 formatting (Linux)

- How to configure Ceph stored on CentOS 7.0 (Server)

- RPM package fabrication method (Linux)

- Configuring ftp server and nfs server under Linux (Server)

 
         
  KVM virtualization of nested virtualization
     
  Add Date : 2017-01-08      
         
         
         
  This paper test the physical machine for the CentOS 6.5

Physical machine using Intel-V virtual infrastructure, install qemu-kvm version 0.12

We know that the Intel processor, KVM using Intel's vmx (virtul machine eXtensions) to improve virtual machine performance, that hardware-assisted virtualization technology, now we need to test if a openstack cluster, or simply need to have more than one " vmx "supported host, but they do not have much physical servers can be used, if our virtual machines and physical machines support" vmx ", then the problem is solved, but under normal circumstances, a virtual machine can not make myself become hypervisors and install a virtual machine on again, because these virtual machines do not support the "vmx"

Nested is a virtual nested can be enabled by a kernel function parameters. It enables a virtual machine with a physical machine CPU features, support vmx or svm (AMD) hardware virtualization. About nested specific description, you can see here

1. First view of a conventional KVM virtual machine CPU information


Copy the code
[Root @ localhost ~] # lscpu
Architecture: x86_64
...
Vendor ID: GenuineIntel
Hypervisor vendor: KVM
Virtualization type: full
...

[Root @ localhost ~] # cat / pro / cpuinfo
processor: 1
vendor_id: GenuineIntel
cpu family: 6
model: 13
model name: QEMU Virtual CPU version (cpu64-rhel6)
...
flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm unfair_spinlock pni cx16 hypervisor lahf_lm

Copy the code
We can see that the virtual machine uses a full virtualization, CPU use for QEMU simulated CPU, and does not support hardware virtualization (flags no vmx)

2. Open nested support physical servers

For physical machine kernel support nested, the first step you need to upgrade the kernel to Linux 3.X version, the second step is to add a new kernel boot parameter

By default, the system does not support nested

# View the current system supports nested
systool -m kvm_intel -v | grep -i nested
nested = "N"
# View or so
cat / sys / module / kvm_intel / parameters / nested
N

The first step to upgrade the kernel, the kernel to do the test with 3.18, upgrade the kernel is very simple, download the compiled kernel rpm package, here is the address to download, install, and then modify the grub.conf default kernel to boot the new kernel

The second step to add boot parameters equally simple, only need to add that at the end of the kernel line "kvm-intel.nested = 1"


Copy the code
# Upgrade the kernel
rpm -ivh kernel-ml-3.18.3-1.el6.elrepo.x86_64.rpm

# Modify grub.conf
default = 0 # Use the new kernel
timeout = 5
splashimage = (hd0,0) /grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (3.18.3-1.el6.elrepo.x86_64)
    root (hd0,0)
    kernel /vmlinuz-3.18.3-1.el6.elrepo.x86_64 ro root = UUID = 9c1afc64-f751-473c-aaa6-9161fff08f6f rd_NO_LUKS rd_NO_LVM LANG = en_US.UTF-8 rd_NO_MD SYSFONT = latarcy
rheb-sun16 crashkernel = auto KEYBOARDTYPE = pc KEYTABLE = us rd_NO_DM rhgb quiet kvm-intel.nested = 1
...

Copy the code

After the above changes, reboot the system with "uname -r" View system kernel and check whether the nested support

3. Establish a support "vmx" virtual machine

If you manage virtual machines using libvirt, you need to modify the definition of a virtual machine xml file in the CPU, the following are three definitions


Copy the code
# Can use this
  < Cpu mode = 'custom' match = 'exact'>
    < Model fallback = 'allow'> core2duo < / model>
    < Feature policy = 'require' name = 'vmx' />
  < / Cpu>
# Defined in this way for virtual machines need to simulate CPU type "core2duo", and added "vmx" feature for the virtual machine

# You can also use this
  < Cpu mode = 'host-model'>
    < Model fallback = 'allow' />
  < / Cpu>

# Or so
 < Cpu mode = 'host-passthrough'>
    < Topology sockets = '2' cores = '2' threads = '2' />
  < / Cpu>
#CPU Penetration seen in the virtual machine CPU vcpu will work with the same physical machine configuration, the disadvantage is that this approach if you want to migrate virtual machines, migrate purpose server hardware configuration must match the current physical machine

Copy the code

 If you use qemu-kvm command line to start the virtual machine, you can simply add

-enable-kvm -cpu qemu64, + vmx
# Set the virtual machine CPU is qemu64 model, add vmx support

Then start the virtual machine, review your configuration

# The following virtual machine CPU is defined as the "host-model"
cat / proc / cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 26
model name: Intel Core i7 9xx (Nehalem Class Core i7)
...
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc unfair_spinlock pni vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic
...
     
         
         
         
  More:      
 
- Tmux Getting Start (Linux)
- Netapp storage routine inspections and information gathering (Linux)
- Download Google Android source code under Ubuntu 4.4 (Linux)
- When Linux Detailed time zone and common function of time (Linux)
- Squid proxy server configuration under Linux (Server)
- Orabbix binding Python send graphical reports (Linux)
- Fedora 21 setting boot script (Linux)
- Quagga use authentication on strengthening BGP session security (Linux)
- Yii2 Advanced Version Copy New Project Problem Solved (Programming)
- Oracle online redefinition (Database)
- Neo4j map data processing tab (Database)
- CentOS How to mount the hard drive (Linux)
- Python Basics Tutorial - lambda keyword (Programming)
- Python: Finding meet the conditions specified in the file directory (Programming)
- Ubuntu prevent arp attacks (Linux)
- A brief description of Java 8 new features introduced syntax (Programming)
- Under CentOS yum install Nginx smooth switch mounted to Tengine (Server)
- How to Install SeaMonkey 2.25 for Ubuntu (Linux)
- Android shutdown (reboot) process (Programming)
- CentOS7 install JDK (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.