KVM is the abbreviation for kernel-based virtual machine, an open source system virtualization module that is integrated into the major distributions of Linux since Linux 2.6.20. It is managed using Linux's own scheduler, so its core source code is few compared to Xen. KVM has become one of the mainstream VMM in academia today.
KVM Virtualization requires hardware support (such as Intel VT Technology or AMD V technology). is hardware-based full virtualization. The early days of Xen were software-based simulations of para-virtualization, and the new version was full virtualization based on hardware support. But Xen itself has itself to the process scheduler, storage Management module, etc., so the code is rather large. The widely circulated business system virtualization software VMware ESX series is also based on software simulation para-virtualization.
KVM (kernel-based virtual machine) is a full-featured virtualization solution on the Linux x86 hardware platform, including a loadable kernel module Kvm.ko providing and virtualizing core architecture and Processor specification modules.
With KVM, you can allow multiple virtual machines to run, including Linux and the Windows operating system. Each virtual machine has private hardware, including network cards, disks, and graphics adapter cards.
--Installing KVM
(1. Check if the CPU provides support for virtual technology (Intel VT or AMD SVM)
[[email protected] ~]# egrep ' VMX|SVM ' /proc/cpuinfoflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc Aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt xsave avx f16c hypervisor lahf_lm arat epb pln pts dts tpr_shadow vnmi ept vpid fsgsbase smepflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts Mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 X2apic popcnt xsave avx f16c hypervisor lahf_lm arat epb pln pts dts tpr_shadow vnmi ept vpid fsgsbase smep
(2. Adding host Hosts
[Email protected] ~]# echo "127.0.0.1 ' hostname '" >>/etc/hosts
(3. Required Packages for installing KVM
[email protected] ~]# Yum install KVM virt-viewer virt-manager libvirt libvirt-python python-virtinst bridge-utils tunctl -Y
(4. Start the KVM service
[[email protected] ~]#/ETC/INIT.D/LIBVIRTD start# has output message stating start success [[email protected] ~]# Lsmod | grep kvmkvm_intel 54285 0 KVM 333172 1 kvm_intel
(5. Setting up a bridging network
#br1 [[email protected] ~]# vim/etc/sysconfig/network-scripts/ifcfg-br1device=br1type=bridgeonboot=yesbootproto= Staticipaddr=192.168.64.128netmask=255.255.255.0gateway=192.168.64.2#eth0[[email protected] ~]# vim/etc/sysconfig /network-scripts/ifcfg-eth0device=eth0type=ethernetonboot=yesbridge=br1[[email protected] ~]#/etc/init.d/network Restart
(6. Modify the configuration file qemu.conf
[Email protected] ~]# sed-i ' s/^ #vnc_listen = "0.0.0.0"/vnc_listen = "0.0.0.0"/'/etc/libvirt/qemu.conf#vnc login password [email Protected] ~]# sed-i ' s/^ #vnc_password = "XYZ12345"/vnc_password = "vnc2015"/'/etc/libvirt/qemu.conf[[email protected] ~]# sed-i ' s/^ #user = "root"/user = "root"/'/etc/libvirt/qemu.conf[[email protected] ~]# sed-i ' s/^ #group = "root"/grou p = "root"/'/etc/libvirt/qemu.conf
(7. Restart the KVM and network
[[Email protected] ~]# service network Restart[[email protected] ~]# service LIBVIRTD restart
--Install the virtual machine [using Kickstart batch installation]
(1. Create a qcow2 format disk file
[[email protected] ~]# mkdir-p/datadir/kvm/vhosts[[email protected] ~]# Cd/datadir/kvm/vhosts[[email protected] vhosts ]# qemu-img create-f qcow2 yunwei-201.qcow2 200G formatting ' yunwei-201.qcow2 ', Fmt=qcow2 size=214748364800 encry Ption=off cluster_size=65536 [[email protected] vhosts]# qemu-img info yunwei-201.qcow2image:yunwei-201.qcow2file Format:qcow2virtual size:200g (214748364800 bytes) disk size:136kcluster_size:65536
(2. Installing the virtual machine [parameter details:virt-install--help]
[[email protected] vhosts]# virt-install --name yunwei-201 > --ram 1024 --vcpus=2 --os-variant=rhel6 #kickstart访问地址 (ISO image catalog) > --location=http:// 192.168.64.254/os/centos-6.5 #kickstart访问地址 (KS configuration file) > --extra-args= "ks=http://192.168.64.254/ Centos-6.5.cfg " #磁盘文件路径 > --disk path=/datadir/kvm/vhosts/yunwei-150.qcow2,size=200,format= qcow2,bus=virtio > --bridge=br1,model=virtio #网卡mac信息 > --mac=00:50:56:3E:20:AE > --mac=00:50:56:3E:21:AE #vnc访问端口 > --vnc --vncport=5900 --vnclisten= 0.0.0.0 Start Installation ... Search for Files vmlinuz...... | 7.9 mb 00:00 ... Search Files initrd.img...... | 64 MB 00:00 ... Create a domain ...... | 0 b 00:00 Unable to open the show: Run ' virt-viewer --help ' to see the available command-line options for a complete list of field installations still in progress. You can reconnect to the console to complete the installation process.
(3. Log in to the console using the VNC tool to see the progress of the installation ...
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/13/wKiom1Wwp8qB2U63AAMqBHP0KAg340.jpg "title=" 4.jpg " alt= "Wkiom1wwp8qb2u63aamqbhp0kag340.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M02/70/10/ Wkiol1wwqclr0wbvaajfhkwocgc081.jpg "title=" 15.jpg "alt=" wkiol1wwqclr0wbvaajfhkwocgc081.jpg "/>650) this.width= 650; "Src=" http://s3.51cto.com/wyfs02/M02/70/13/wKiom1Wwp-7ARr49AAF5bZoyfaI345.jpg "title=" 2.jpg "alt=" Wkiom1wwp-7arr49aaf5bzoyfai345.jpg "/>650) this.width=650;" Src= "http://s3.51cto.com/wyfs02/M00/70/10/ Wkiol1wwqets8mexaakqimq3spg228.jpg "title=" 3.jpg "alt=" wkiol1wwqets8mexaakqimq3spg228.jpg "/>650) this.width= 650; "Src=" http://s3.51cto.com/wyfs02/M01/70/10/wKioL1WwqfTREZavAAEwI-EPTJA144.jpg "title=" 5.jpg "alt=" Wkiol1wwqftrezavaaewi-eptja144.jpg "/> To this point, KVM use Kickstart bulk installation of operating system deployment completed, the shortcomings of the note, learn from each other.
This article is from the "ˉt, Stand Wentao ┃﹎" blog, please be sure to keep this source http://hypocritical.blog.51cto.com/3388028/1677625
Under the CentOS-6.5 of the production environment, KVM uses kickstart to install the operating system in bulk