Containers Expo Blog Authors: Elizabeth White, Yeshim Deniz, Liz McMillan, Pat Romanski, Zakia Bouachraoui

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 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.

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
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
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...
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
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...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...