What
This is the virtualization module added to Linux kernel to function as a hypervisor. KVM requires a processor with hardware virtualization extensions, such as Intel VT or AMD-V
A hypervisor is a software layer installed on the physical hardware that creates and runs several virtual machines (VMs).
History
Avi Kivity started the development of KVM in 2006 at Qumranet, Inc which was acquired by Red Hat in 2008. KVM was merged into Linux Kernel version 2.6.20 on 5th February 2007.Avi Kivity worked as a Lead developer/maintainer of KVM open source Linux hypervisor in 2008
Alternatives
There are many alternatives, following are few softwares.
- Oracle VM VirtualBox – Created by Innotek GmbH which was acquired by Sun Microsystems in 2008 and later which was acquired by Oracle in 2010.
- VMware Workstation – Created by VMware, Hosted hypervisor that runs on x64 versions of Windows and Linux operating systems
- QEMU (Quick EMUlator) – Created by Fabrice Bellard and its a free open-source emulator that performs hardware virtualization.
- Xen – Originated as a research project at the University of Cambridge led by Ian Pratt and supported by XenSource and later acquired by Citrix in 2007. Xen provide services to run multiple computer operating systems on the same computer hardware concurrently.
- Parallels Desktop – By Parallels released in 2006 and it’s the first software to bring mainstream virtualization to Macintosh computers utilizing the Apple–Intel architecture
Note : The KVM developers took advantage of QEMU architecture and created a new model of CPU in QEMU which has KVM specific logic. So nowadays when you refer to KVM hypervisor, you actually mean the QEMU-KVM combination.
Why
KVM is an Open source and its free to use as per the GNU General Public License. It is simple and easy to use comparing to another virtualization software’s. It can host windows guest virtual machines. KVM performance will be good and zero maintenance, I have very good experience with KVM installed on HP Machines & Dell PowerEdge for past 10 years.The only drawback is you cannot run KVM server on Windows machines.
How
In this scenario we are installing Centos7 in a physical server which has two network interfaces . We are creating a bonding with these two-network interface and then creating VLANs. The VLAN network has to be configured properly in switches connected backend if any.
1. Install Centos 7 minimal 2. Update OS yum update 3. Make sure your system supports virtulization egrep -o '(vmx|svm}' /proc/cpuinfo 4. Check the required kernal modules lsmod | grep kvm 5. Load the kernal modules modprobe kvm modprobe kvm_intel modprobe kvm_amd 6. Make sure /dev/kvm is available ls -al /dev/kvm 7. Install Bridge Utils yum -y bridge-utils 8. Make sure IP forwarding Enabled is sysctl.conf grep "net.ipv4.ip_forward" /etc/sysctl.conf net.ipv4.ip_forward = 1 9. Disable the NetworkManager service systemctl stop NetworkManager systemctl disable NetworkManager 10. Enable VLAN Tagging Module modprobe 8021q lsmod | grep 8021q 11. Network Bonding setup vi /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 ONBOOT=yes BOOTPRO=none USERCTL=no NM_CONTROLLED=no BONDING_OPTS="mode=1 miimon=1000" NOZEROCONF=yes Note: If jumbo frames are needed, add the line MTUSIZE=9000 vi /etc/modprobe.d/bond0.conf alias bond0 bonding vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes NOZEROCONF=yes vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none USERCTL=no MASTER=bond0 SLAVE=yes NOZEROCONF=yes 12. VLAN on Bond0 vi /etc/sysconfig/network-scripts/ifcfg-bond0.200 DEVICE=bond0.200 ONBOOT=yes BRIDGE=brvlan200 VLAN=yes vi /etc/sysconfig/network-scripts/ifcfg-brvlan200 DEVICE=brvlan200 ONBOOT=yes BOOTPRO=static USERCTL=no NM_CONTROLLED=no IPADDR=10.1.200.1 NETMASK=255.255.255.0 GATEWAY=10.1.200.254 TYPE=Bridge NOZEROCONF=yes DELAY=0 13. Create n number of VLANs as required vi /etc/sysconfig/network-scripts/ifcfg-bond0.10 DEVICE=bond0.10 ONBOOT=yes BRIDGE=brvlan10 VLAN=yes vi /etc/sysconfig/network-scripts/ifcfg-brvlan10 DEVICE=brvlan10 ONBOOT=yes BOOTPRO=none NOZEROCONF=yes TYPE=Bridge DELAY=0 vi /etc/sysconfig/network-scripts/ifcfg-bond0.11 DEVICE=bond0.11 ONBOOT=yes BRIDGE=brvlan11 VLAN=yes vi /etc/sysconfig/network-scripts/ifcfg-brvlan11 DEVICE=brvlan11 ONBOOT=yes BOOTPRO=none NOZEROCONF=yes TYPE=Bridge DELAY=0 Note: Create as many as required. We can even create later whenever required 14. Restart network and check Bridge and bonding status systemctl restart network brctl show cat /proc/net/bonding/bond0 15. Install KVM Packages and Tools yum -y install qemu-kvm libvirt virt-install virt-viewer libguestfs-tools virt-manager bridge-utils (OR) yum groupinstall "Virtualization Client" "Virtualization Tools" "Virtualization Platform" 16. Verify KVM Module loaded and start libvirt lsmod | grep kvm systemctl enable --now libvirtd 17. Selinux and IPtables are switched off - Do the required configurations if you switched on. 18. KVM profile fine tuning yum install tuned systemctl enable --now tuned tuned-adm list (List the available Profile) tuned-adm active (Check Status) tuned-adm profile virtual-host (Change the profile to VH) 19. Reboot Server (if okay) tuned-adm active 20. Run the virsh command and make sure KVM running okay virsh list