Welcome!

Containers Expo Blog Authors: Elizabeth White, Yeshim Deniz, Pat Romanski, Liz McMillan, Ravi Rajamiyer

Related Topics: Containers Expo Blog, Microservices Expo, Linux Containers, Open Source Cloud

Containers Expo Blog: Article

Virtualization Comes in More than One Flavor

Emulation, paravirtualization, operating system-level virtualization

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:

  1. Two-level disk quota - The OpenVZ server administrator can set per-VE disk quotas in terms of disk space and number of inodes. This is the first level of disk quota. The second level of disk quota lets the VE administrator (VE root) use standard Unix quota tools to set per-user and per-group disk quotas.
  2. "Fair" CPU scheduler - The OpenVZ CPU scheduler is also two levels. On the first level it decides which VE to give the time slice to, taking into account the VE's CPU priority and limit settings. On the second level, the standard Linux scheduler decides which process in the given VE to give the time slice to, using standard process priorities.
  3. User Beancounters - This is a set of per-VE counters, limits, and guarantees. There's a set of about 20 parameters that are carefully chosen to cover all the aspects of VE operation so no single VE can abuse any resource that is limited for the whole computer and thus do harm to other VEs. The resources accounted and controlled are mainly memory and various in-kernel objects such as IPC shared memory segments, network buffers, etc.
Checkpointing allows for the "live" migration of a VE to another physical server. The VE is "frozen" and its complete state is saved to a disk file. This file can then be transferred to another machine and the VE can be "unfrozen" (restored) there. The whole process takes a few seconds, and from the client's point of view it looks like a delay in processing, not downtime, since the established network connections are also migrated.

OpenVZ Utilities
OpenVZ comes with a vzctl utility, which implements a high-level command-line interface to manage Virtual Environments. For example, to create and start a new VE takes just two commands - vzctl create and vzctl start.

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.

Templates
Templates are pre-created images used to create a new VE. A template is a set of packages, and a template cache is an archive (tarball) of a chrooted environment with those packages installed. This tarball is unpacked during the vzctl create stage. Using a template cache technique, a new VE can be created in seconds, enabling fast deployment scenarios.

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.

Usage Scenarios
The following usage scenarios are common for all virtualization technologies. However, a unique feature of OS-level virtualization like OpenVZ is that there isn't much overhead penalty to pay, which makes the scenarios more appealing.

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.

Summary
Hopefully, that gives you a better understanding of the different types of Linux virtualization technology, especially, operating system-level virtualization and the OpenVZ open source implementation.

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.

More Stories By Kirill Kolyshkin

Kirill Kolyshkin was named leader and project manager for the OpenVZ project in 2005 to further the adoption of operating system (OS)-level server virtualization. He spearheads the overall development and manages all key architecture, updates and feature upgrades for OpenVZ. Kolyshkin has more than 10 years Linux experience and has long been an active open source advocate. His 15-years career experience includes positions in information technology at Deutsche Bank and telecommunications company, Severtelecom. He holds a degree in Computer Science from the Ukhta State Technical University.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
SYS-CON Events announced today that DatacenterDynamics has been named “Media Sponsor” of SYS-CON's 18th International Cloud Expo, which will take place on June 7–9, 2016, at the Javits Center in New York City, NY. DatacenterDynamics is a brand of DCD Group, a global B2B media and publishing company that develops products to help senior professionals in the world's most ICT dependent organizations make risk-based infrastructure and capacity decisions.
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
Headquartered in Plainsboro, NJ, Synametrics Technologies has provided IT professionals and computer systems developers since 1997. Based on the success of their initial product offerings (WinSQL and DeltaCopy), the company continues to create and hone innovative products that help its customers get more from their computer applications, databases and infrastructure. To date, over one million users around the world have chosen Synametrics solutions to help power their accelerated business or per...
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great deals to great conferences, helping you discover new conferences and increase your return on investment.
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by FinTechEXPO. ICOHOLDER gives detailed information and help the community to invest in the trusty projects. Miami Blockchain Event by FinTechEXPO has opened its Call for Papers. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Miami Blockchain Event by FinTechEXPOalso offers sp...
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
SYS-CON Events announced today that IoT Global Network has been named “Media Sponsor” of SYS-CON's @ThingsExpo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. The IoT Global Network is a platform where you can connect with industry experts and network across the IoT community to build the successful IoT business of the future.
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.