Introduction to Virtualization Concepts

What is Virtualization?

In Cloudmin, virtualization refers to running a virtual system that appears from the inside to be a real computer, but is actually being emulated on a real machine. The terms "virtual machine" and "VPS" are also used to refer to these, as are type-specific terms like "Xen guest", "OpenVZ container" and "EC2 instance". There are several different technologies that can be used to implement virtualization, which varying support for different operating systems, resource isolation and resource overheads.

Why Use Virtualization?

The most common case is to provide customers or users with what appears to be their own system on which they have full root access and control of all services, but without the overhead of maintaining an actual physical machine. For example, a hosting company might sell virtual systems to customers which in turn use them for web hosting, database hosting or email.

A single physical machine can host multiple virtual systems, each of which is granted a slice of its memory, disk space and CPU time. Each virtual system is protected from others on the same host system. Because many applications or customers do not require the full CPU, RAM or disk capacity of a real systems, virtualization can be used to safely host several on a single physical system, thus saving resources.

Another advantage of Virtualization is the ability to easily move virtual systems between hosts without interruption or the need to re-install applications. If a hardware problem is detected on a host system, all virtual machines on it can be moved to a new host without changing their IP addresses or other settings, and possibly without even interrupting running processes.

Virtualization Types

Not all virtualization technologies are created equal - some (like Xen) provide more isolation between systems but at the cost of additional CPU and RAM overhead, while others (like OpenVZ) can be used to host more virtual systems per physical system, but with more chance of cross-system disruption.

Virtualization types can be generally separated into two categories :

  • Separate Kernels
    Examples : Xen, KVM, Amazon EC2
    These types run a separate kernel for each virtual system, and typically store system files within a disk image or logical volume instead of on the host system's filesystem. RAM used is higher due to the need to run a copy of the kernel for each system, and free disk space and RAM cannot be used by other systems. However they provide more protection and isolation between systems, allow different kernels to be used, and provide more flexibility in filesystem and disk usage within the virtual systems.

  • Shared Kernel
    Examples : OpenVZ, LXC, Vservers, Solaris Zones
    These types run under the host system's kernel, which provides filesystem and process isolation between systems. Typically each system's files are stored under some directory on the host, possibly with common files like binaries being shared. They offer less isolation and force use of the same kernel, but the per-virtual-system RAM, CPU and disk overhead is lower. Also, RAM and disk space can potentially be over-committed to make better use of host system resources.

Which Virtualization Type to Use?

If you are running Solaris systems, you really only have one choice - Solaris Zones.

On Linux, your choice depends on the level of isolation you want and how much RAM and CPU overhead you are willing to tolerate. Given the ample CPU and RAM on most modern systems, we recommend using Xen as the overhead is usually tolerable unless you plan to run a large number of small virtual systems. In that case, OpenVZ is the best solution. KVM is similar to Xen in its resource use, but tends to have more overhead as it does not support paravirtualization.

Cloudmin also supports Linux Vservers, but this appears to be poorly maintained and offers no advantages over OpenVZ. As of Cloudmin 5.4, LXC is also supported on Linux. It has the advantage of being a standard part of recent Linux kernels, but lacks many features of OpenVZ such a live migration and disk space limits.

Amazon EC2 is different from other virtualization types in that the virtual systems don't actually run on your own machines - instead, they are hosted by Amazon for an hourly cost. It is worth using if your needs are highly variable, for example if you plan to run a hundred systems for a few hours a day then shut them down.