How does kvm hypervisor work




















The kernel based Virtualization leverages the advantages of 3rd and 4th approach mentioned above. A Hypervisor is nothing but a middle layer of program, between the guest operating system and host systems hardware. The hypervisors can be of two types: native or hosted. Please refer the figure below. It represents a bare-metal native hypervisor. So, as a modern solution for the effective virtualization, kernel based virtual machine KVM evolved.

It essentially uses the CPU extensions provided by modern hardware virtualization supporting CPUs, by a module with the kernel of host operating system. By use of this kernel based virtualization module, the kernel of the host operating systems works as a hypervisor leveraging the features of Linux kernel and the hardware supporting the virtualization.

Using KVM we can run multiple virtual machines with any operating system, on a single machine or say the host system. KVM is introduced in Linux Kernel since 2. Have you already installed Fedora Workstation as your main OS? There are a lot of options. We will use several basic tools. Other Linux distributives can have some differences. First of all, let's check if hardware virtualization is supported.

Actually, everything will work without it, too, but much slower. KVM is a Linux kernel module, so we need to check if it is already downloaded and if not, then download it. It is possible that hardware virtualization is not enabled in BIOS. Now let's install the necessary packages. The easiest way to do this is by installing a group of packages at once:.

The list of groups depends on the OS you use. Mine was called Virtualization. A tool virsh is used for managing virtual machines from a console. Check if you have at least one VM with the help of a command virsh list. It is likely that you don't. Luckily, there is also a virt-manager and a command virt-install. You will explore GUI yourself, and here is the example of virt-install usage:.

Instead of specifying the disk size, you can create it in advance via virt-manager, or with the help of virsh and an XML file. Here above, I have used an iso with Centos 7 minimal, which is pretty easy to find on the Centos website. Now, one important question remains: how to connect to created machine?

The easiest way to do this is via virt-manager — it's enough to double click the created machine, and a window with SPICE connection will open. There you will see an OS installation screen. After you install the OS manually, you will immediately wonder how all this process can be automated.

For this, we will need a tool named Kickstart , which is intended for OS automatic first configuration.

This is a simple text file, in which you can specify the OS configuration, including different scripts to be executed after installation. But where do I get one? Don't I have to write it from scratch? You just need to copy and edit it. But it's not interesting just to copy the file, so we'll add a little something to it. You see, by default, we won't be able to connect to a VM console from a host-machine console.

To do this, you need to edit config inside of a GRUB bootloader. That's why, let's add the following section at the end of a Kickstart file:. A command grubby will update GRUB config, adding a possibility to connect to a console to it. By the way, you can enable connecting to a console during the VM creation.

For this, pass one more argument to the virt-install command. After this, you can install the OS itself via online text mode right from your host-machine console, connecting to a VM via virsh console immediately after its creation.

It's especially convenient when you are creating VMs on a hardware remote server. Now we can apply the config! Dear reader is offered to study it with a proper curiosity. KVM can use a wide variety of certified Linux-supported hardware platforms. Because hardware vendors regularly contribute to kernel development, the latest hardware features are often rapidly adopted in the Linux kernel. KVM inherits the memory management features of Linux, including non-uniform memory access and kernel same-page merging.

The memory of a VM can be swapped, backed by large volumes for better performance, and shared or backed by a disk file.

KVM supports live migration, which is the ability to move a running VM between physical hosts with no service interruption. The VM remains powered on, network connections remain active, and applications continue to run while the VM is relocated.

KVM also saves a VM's current state so it can be stored and resumed later. KVM inherits the performance of Linux, scaling to match demand load if the number of guest machines and requests increases.

The Linux scheduler allows fine-grained control of the resources allocated to a Linux process and guarantees a quality of service for a particular process. In KVM, this includes the completely fair scheduler, control groups, network name spaces, and real-time extensions. The Linux kernel features real-time extensions that allow VM-based apps to run at lower latency with better prioritization compared to bare metal.

The kernel also divides processes that require long computing times into smaller components, which are then scheduled and processed accordingly. Large enterprises use virtualization management software that interfaces with virtual environments and the underlying physical hardware to simplify resource administration, enhance data analyses, and streamline operations.

Red Hat created Red Hat Virtualization for exactly this purpose. The KVM that ships with Red Hat Enterprise Linux has all of the hypervisor functionality with basic management capabilities, allowing customers to run unlimited isolated virtual machines on a single host. Red Hat Virtualization contains an advanced version of KVM that enables enterprise management of unlimited guest machines.

Do you have a legacy app that requires an older operating system? This is all you need. Install it on anything—from bare-metal hardware to open source or proprietary systems—and start deploying virtual machines by the dozens or hundreds with an advanced hypervisor that can handle it and a management platform that makes it easy.

Sign up for our free newsletter, Red Hat Shares. Open hybrid cloud Support Developers Partners Start a trial.



0コメント

  • 1000 / 1000