Most Read This Week
Virtualization Comes in More than One Flavor
Emulation, paravirtualization, operating system-level virtualization
By: Kirill Kolyshkin
Feb. 13, 2007 11:00 AM
When you think about virtualization, you probably think about VMware, or maybe Xen, and hopefully, even OpenVZ. With all the buzz surrounding this space, I thought it time to discuss three of the four different types of virtualization: emulation, paravirtualization, operating system-level virtualization, and multi-server (cluster) virtualization. The last is outside the scope of this article.
Each virtualization type has pros and cons that impact its appropriate application.
Emulation makes it possible to run any non-modified operating system that supports the platform being emulated. Implementations in this category range from pure emulators (like Bochs) to solutions that let some code to be executed on a real CPU natively, or by patching the code during runtime - to increase performance. The main disadvantages of emulation are low performance and low density. Examples: VMware products, QEmu, Bochs, Parallels.
Paravirtualization is a technique used to run multiple modified operating systems on top of a thin layer called a hypervisor, or virtual machine monitor. Paravirtualization has better performance than emulation, but the disadvantage is that the "guest" OS has to be modified. Examples: Xen, UML.
Operating system-level virtualization enables multiple isolated execution environments in a single operating system kernel. It has the best possible (i.e., close to native) performance and density, and features dynamic resource management. On the other hand, this technology can't run different kernels from different operating systems at the same time. Examples: FreeBSD Jail, Solaris Zones/Containers, Linux-VServer, OpenVZ, Virtuozzo.
Let's examine the concept of Virtual Environments (VE, also known as VPS, containers, partitions, etc.), which is an isolated program execution environment and (from the point-of-view of its owner) looks and feels like a separate physical server. A VE has its own set of processes starting from init, file system, users (including root), network interfaces with IP addresses, routing tables, firewall rules (netfilter/iptables), etc.
Multiple VEs can co-exist on a single physical server. While different VEs can run different Linux distributions, all VEs operate under the same kernel.
Now, let's look more closely at the OpenVZ kernel, which is a modified Linux kernel that adds virtualization and isolation of various subsystems, resource management, and checkpointing.
Virtualization and isolation enable many virtual environments within a single kernel. The resource management subsystem limits (and in some cases guarantees) resources, such as CPU, RAM, and disk space on a per-VE basis. Checkpointing is the process of "freezing" a VE, saving its complete state to a disk file, with the ability to "restore" that state later.
Resource management is of paramount importance for operating system-level virtualization technology, because there's a finite set of resources within a single kernel that are shared among multiple Virtual Environments. All those resources need to be controlled in a way that lets many VEs co-exist on a single system and not impact each other.
The OpenVZ resource management subsystem consists of three components:
To change various VE parameters, the vzctl set command is used. Note that all the resources (for example, VE virtual memory size) can be changed during runtime. This is either impossible or difficult to implement in other virtualization technologies like emulation or paravirtualization.
Vzpkg tools are a set of tools to facilitate template cache creation. It currently supports RPM- and yum-based repositories. For example, to create a template of Fedora Core 5 distribution, one needs to specify a set of (yum) repositories that have FC5 packages, and a set of packages to be installed.
Pre- and post-install scripts can also be employed to optimize/modify a template cache further. All the data above (like repositories, lists of packages, scripts, and GPG keys) form template metadata. With template metadata, the vzpkgcache utility can automatically create a template cache . It will download and install the listed packages into a temporary VE, and pack the result as a template cache. Template caches for non-RPM distributions can be created too, although it's more of a manual process.
Server consolidation allows an organization to decrease the number of physical servers it uses by moving its applications into virtual environments; the number of operating system environments remains the same. This saves hardware costs, rack space, electricity, and management efforts.
Security can be drastically improved by putting each network service (like Web server, mail server, etc.) into a separate isolated Virtual Environment. If there's a security hole in one of the applications, the others aren't affected. The ability to manage resources dynamically and migrate live applications is an added bonus.
Software development and testing - Developers and testers usually need access to a handful of Linux distributions, and they need to reinstall them from scratch a lot. Using virtualization, developers can operate multiple distributions at native performance using a single server without having to reboot; a new virtual environment can be created in just a minute. Cloning a VE is also simple.
Educational - Each student can have a VE and play with different Linux distributions. A new VE can be (re)created in a minute.
The OpenVZ project is freely distributed and offers support to its users, promoting operating system virtualization through a collaborative community effort. Supported by SWsoft, the OpenVZ project serves the needs of community developers, testers, documentation experts, and other technology enthusiasts who wish to participate in and accelerate the technology development process. OpenVZ is the open source software used as the basis of Swsoft's Virtuozzo virtualization software.
The OpenVZ project is actively working to incorporate operating system-level virtualization in the mainstream Linux kernel. Some progress has been made with the latest pre-patch for the stable Linux kernel tree, 2.6.19-rc1, including some contributions from OpenVZ, IBM, and Eric Biederman. This is an ongoing initiative.
Reader Feedback: Page 1 of 1
Subscribe to the World's Most Powerful Newsletters
Today's Top Reads