CentOS6.5 for KVM virtualization platform deployment

KVM profile
Kernel-based Virtual Machine for short, is an open source system virtualization module, integrated since Linux 2.6.20 in all major Linux distributions. It uses Linux managed its own scheduler, so relative to the Xen, its few core source code. KVM has now become one of the main VMM.
KVM virtualization requires hardware support (such as Intel VT or AMDv technology). Is a hardwarebased full virtualization. And the early Xen is a softwarebased Para-Virtualization, the new version is based on hardware support for full virtualization. But Xen has their own process scheduler, storage management module, so the code is enormous. Popular commercial system virtualization software VMware ESX series is based on simulation software Full-Virtualization.
KVM virtualization platform deployment
Check if the hardware supports virtualization
[root@test ~]# egrep –color ‘(vmx|svm)’ /proc/cpuinfo
Note: (I Centos6.5 x64 built in the VMware and supported CPU virtualization technology Inter VT-X, physical BIOS is already open, but the module does not have a VMX.)
Solution (for VMware testing machines only): for nested virtualization on a workstation, you need to edit the vmx file for the virtual machine, add VHV.enable = TRUE” find virtual machines to install file with. vmx suffix added.
# cat /proc/cpuinfo
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_ tsc aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi ept vpid
Install module
[root@test ~]# modprobe kvm
[root@test ~]# modprobe kvm_intel
[root@test ~]# lsmod | grep kvm
kvm_intel 55496 0
kvm 337772 1 kvm_intel
Install the KVM management tools
# yum install qemu-kvm qemu-kvm-tools -y
# ln -sv /usr/libexec/qemu-kvm /usr/sbin/
# rpm -qa | grep kvm
QEMU-KVM standard options
QEMU-KVM standard option relate mainly to the specified host type, CPU mode, NUMA optical drive, floppy devices, equipment and hardware equipment.
-Name name: sets the virtual machine name;
-M machine: specify the host type to simulations, such as a Standard PC, ISA-only, such as PC or Intel-Mac, you can use the QEMU-? Gets the support of all types;
-M megs: set the virtual machine‘s RAM size;
-CPU Model: set the CPU model, like coreduo, qemu64, and so on, you can use the QEMU-? Gets the support of all models;
-SMP n[,cores=cores][,threads=threads][,sockets=sockets][,maxcpus=maxcpus]: set the number of CPU in SMP architecture simulation, each CPU core number and CPU socket number; on the PC can emulate up to 255 CPU;maxcpus is used to specify the CPU thermal insert the maximum number;
-NUMA opts: Specifies that the simulation of the NUMA node device;
-fda file
-Fdb file: Specifies the file (file) as a floppy image, file is/dev/fd0 means to use a physical floppy drive;
-hda file
-hdb file
-hdc file
-HDD file: use the specified file as a hard disk image;
-CDROM file: use the specified file as a CD-ROM image, note that-cdrom and-hdc cannot be used; specify a file as/dev/cdrom you can use physical drive;
-drive option[,option[,option[,…]]] Defining a hard disk device; many options there are available.
File=/path/to/somefile: hardware image file path;
If=interface: Specifies the interface type hard disk device is connected, the controller type, including IDE, SCSI, SD, MTd, and floppy, and virtio pflash etc;
Index=index: sets the index numbers of different devices in the same controller type, identification number;
Media=Media: defines the media types for the hard disk (disk) or CD (CDROM);
Snapshot=snapshot: specify the current hard disk device supports snapshot feature: on or off;
Cache=cache: defines how to access data using physical cache, its available values are none, writeback, unsafe and WriteThrough four;
Format=format: Specifies the image file format, format see QEMU-IMG command;
-Boot [order=drives][,once=drives][,menu=on|off]: defines boot device boot order, each device uses a character different devices supported by the schema and its characters are not the same, x86 PC architectures, floppy drive is a, b, c for the first disk, d represents the first optical drive devices, n-p indicates the network adapter defaults to hard disk device;
-boot order=dc,once=d
QEMU-KVM display options
Display options display interface is used to define a virtual machine startup type and properties, and so on.
-Nographic: default, QEMU use SDL to display VGA output; this option is used to prevent the graphics interface, this time, QEMU is a simple command-line program which serial port devices to be redirected to the console;
-Curses: prohibition of the graphical interface and use curses/ncurses as an interactive interface;
-ALT-grab: using Ctrl+Alt+Shift keys release the mouse;
-CTRL-grab: use the right Ctrl key to release the mouse;
-SDL: enable SDL;
-spice option[,option[,…]] : Spice Remote Desktop Protocol enabled; its many options, please refer to the QEMU-KVM manual;
-VGA type: Specifies the type of VGA interfaces to simulation, common types include:
Cirrus:Cirrus Logic GD5446 display card;
Std: standard VGA graphics card with Bochs VBI extension;
Vmware:VMWare SVGA-II-compatible display adapter;
Qxl:QXL half virtualization shows card and VGA compatible after QXL driver is installed in the Guest can work in a good way, in the recommended way of using spice protocol using this type;
None: disable VGA card;
-vnc display[,option[,option[,…]]] : By default, QEMU SDL display VGA output using the-VNC option, you can
Network properties options
Network Properties option defines the type of network device interface and its related attribute information. Here describes only the NIC, tap three types and user network interface properties other types please refer to the QEMU-KVM manual.
-NET NIC[,VLAN=n][,MACADDR=Mac][,model=type][,name=name][,addr=addr][,vectors=v]: create a new network adapter and connect the device to a VLAN in n; PC architecture by default on the e1000,MACADDR used to specify the MAC address of the NIC, when the name is used to specify a monitor displays the device name ; EMU can simulate more than one type of network adapter device, like virtio, i82551, i82557b, i82559er, ne2k_isa, and PCNET, RTL8139, e1000, such as smc91c111, mcf_fec and Lance, but on a different platform, it supports type may only contain a part of the preceding list, you can use the QEMU-NIC,model=? Gets the types supported by the current platform;
-NET tap[,VLAN=n][,name=name][,FD=h][,ifname=name][,script=file][,downscript=DFILE]: through the physical network interface connected to VLAN n TAP, use script=file to specify the script (default is/etc/QEMU-ifup) to configure the network interface, and use the downscript =File the specified script (default is/etc/QEMU-ifdown) to undo interface configuration using script=no and downscript=no, are used to prevent script execution;
-net user[,option][,option][,…] : A usermode configuration network stack, which does not depend on administrative rights; valid options are:
VLAN=n: connecting to VLAN n, the default n=0;
Name=name: Specifies the display name of the interface, used in monitor mode;
NET=addr[/mask]: setting GuestOS IP network mask is optional, the default is;
Host=addr: Specifies the physical IP address of the machine see GuestOS, second defaults to the specified network, namely x.x.x.2;
Dhcpstart=addr: Specifies 16 addresses in the address pool start DHCP service IP by default from the 16th to the 31st, is x.x.x.16-x.x.x.31;
DNS=addr: Specifies the DNS server address GuestOS; defaults to GuestOS third address on the network, that is, x.x.x.3;
TFTP=dir: activate the built-in TFTP server, and uses the specified dir as the default root directory of the TFTP server;
Bootfile=file:BOOTP file names used to implement network boot GuestOS; such as: Linux. user,TFTP=/