📜 ⬆️ ⬇️

Xen PV vs HVM: what to choose?

image Hello, dear users. My name is Pavel, I am an employee of the hosting company NQhost . We specialize in VPS / VDS (virtual servers) services based on Xen technology.
In this article, we will answer one of the most frequently asked questions that come to our support service: what is the difference between paravirtualization (Xen PV) and full hardware virtualization (Xen HVM) and what is actually better to choose.


Xen


Xen is a GPL-distributed hypervisor, or in other words, a virtual machine monitor, originally developed at the University of Cambridge. It supports two virtualization modes: paravirtualization (PV) and hardware virtualization (HVM).
Xen allows you to organize the joint execution of several virtual machines on the same physical while maintaining performance comparable to the real one.

Xen pv

Paravirtualization is a virtualization technology in which guest operating systems are specially prepared to work inside a virtual environment, for which the OS kernel usually changes. Thus, the guest system "knows" that it works in a virtual environment.
Currently, almost all Linux distributions, namely CentOS, Debian, Ubuntu, Gentoo, Fedora, ArchLinux, and others, are able to work in Xen PV mode. Paravirtualization allows you to achieve performance comparable to the performance of a physical server.
')
In PV mode, there are two options for booting Linux: using the kernel with Xen Dom0 (nodes) or running your own kernel, which is located directly inside the VPS container file system. The second boot option is implemented using the PyGrub technology and allows you to run the latest kernel versions (both 32-bit and 64-bit depending on the OS version) for a specific Linux distribution. As a rule, all kernel modules work correctly with the xen-version.

For example, this is how the output of the uname –a command inside the Xen PV container based on Ubuntu 10.10 32bit looks like:
Linux example.com 2.6.32-305-ec2 # 9-Ubuntu SMP Thu Apr 15 04:14:01 UTC 2010 i686 GNU / Linux

At the same time, the physical server on which this container is located is running CentOS x64 with the standard kernel 2.6.18

In addition to the standard ssh, access to the OS inside the Xen PV container can be obtained through console emulation by means of the hypervisor. This is useful if for some reason ssh cannot be used. It is also possible to monitor the boot process of the guest OS.
image

Xen HVM

In the hardware virtualization mode, the guest system does not “know” that it works in a virtual environment - Xen emulates the hardware of a virtual machine using QEMU modules.
To ensure the operation of Xen HVM, it is necessary that the node uses processors with support for Intel-VT or AMD-V technology. Loading such a container is similar to loading a regular physical computer. Remote access at this stage is organized by means of VNC. Here is an example of loading the Xen HVM container and running FreeBSD 8.2 from a mounted image:
image

In Xen HVM mode, it is possible to install almost any operating system: Linux, FreeBSD, NetBSD, or various versions of Windows.

PV vs HVM - what to choose?

The answer to this question is quite simple: if you need a Linux OS and you do not have requirements to install the OS yourself from scratch, feel free to choose Xen PV. The performance of such a VPS container will be higher, and the OS can be installed from ready-made templates.
In those cases when you need a non-Linux-based OS, or if there is a need for some reason to use an unmodified kernel, then the right choice would be Xen HVM.

In one of the following articles we will compare the performance of Xen PV and HVM containers.

Source: https://habr.com/ru/post/117310/


All Articles