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

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
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
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...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...