In the 90s, rack-based network and application appliances provided significant management savings compared to general-purpose stand-alone servers, but they still had a lot of redundant hardware - separate power supplies, coolers, external I/O buses, etc. As a natural evolutionary step, in the 21st century, blades introduced hardware infrastructure sharing and drove management costs down significantly compared to rack-based servers.
Just like hardware appliances, virtual machines don’t share the underlying infrastructure. To create several (N is always a good number) “.NET application server” appliances, OS, .NET runtime, IIS, DTC, COM+ and other required components need to be installed in each VM, creating N independently configured (and licensed) instances of the OS and applications. N instances take N times longer to install, will take N times longer to patch, N times longer to start and stop for maintenance. Plus, there will be N times more potential points of failure.
To avoid this problem, Virtuozzo uses resource sharing. Instead of copying OS and application into each virtual environment, Virtuozzo keeps a single “master” copy of the OS and applications. Instead of physical files, the virtual environment only holds copy-on-write links to the “master” copy. In other words, Virtuozzo provisions OS and applications “by reference”, not “by value”. The centrally installed image of an OS or an application is called a template.
The process of creating a Virtuozzo-based virtual appliance is 1) install the required OS and application templates on a Virtuozzo machine; 2) create a new virtual environment using the desired OS template; 3) provision the required application templates into the virtual environment; 4) clone the virtual environment when you need another instance of this virtual appliance. Now, let’s see how templates make the process of building and managing a virtual appliance a lot more efficient.
A template consists of
· Files – The OS template contains all the files that can be found on a machine right after the clean OS installation. An application template contains all the files that an application adds to the system during its installation.
· Registry - On Windows, the registry needs to be taken into account. The Windows OS template contains all the entries that the registry contains after a clean Windows install. An application template contains all the entries that application installer adds to the registry. Registry entries are written into the virtual environment’s registry when the template is provisioned.
· Links - Besides the actual files, template contains VZFS symbolic links. A link maps file locations on the target virtual environment file system to the file in the template.
Creating a template
The template creation process is relatively straightforward.
On Linux, to build an application template you need to create a configuration file that enumerates high-level application packages and a URL of the package repository. Virtuozzo will automatically download all dependent packages and add them to the template along with those you specified. OS template creation is a bit more tedious due to the more complex dependencies and large number of packages. The best way to create an OS template is to modify one of those shipped with Virtuozzo.
Windows doesn’t have “distributions,” so we simply ship all Windows OS templates with Virtuozzo. Application templates are created by a special tool that records all the file and registry writes during the installation of an application.
Provisioning a template - To provision a template, Virtuozzo copies all links from the template to the target virtual environment. The process takes very little time, since no data is physically copied. The result is that the target virtual environment has copy-on-write links to all the files in the template. Since the links are implemented by VZFS, and not the underlying OS file system, there is no way for an application to distinguish the link from a real file. From an administrator standpoint, provisioning a template to a virtual environment is as simple as running a single command.
Patching - Patching is extremely efficient. On Linux, updates are fully automatic. The same tool that downloads all dependent packages when the template is created will download new versions and update them in the template. Old files are not overwritten; instead links are re-mapped to new versions of the files stored side-by-side. On Windows (due to the registry), the process is a bit more involved.
In any case, once a file is updated in the template, all virtual environments will have the updated version of the file. Regardless of how many virtual environments are running on the machine or the number of virtual environments where an application is running, a patch is only applied once per machine. Also, Virtuozzo can instantly roll-back a “bad” patch by re-mapping the links to the “good” versions of the files.
In addition to template-based application management, Virtuozzo provides the following advantages:
Backup/restore – Virtual environment images are very compact – 10-100 times smaller than the similar VM image - because OS and most applications are stored in the templates. Because of this small size, deployment, backup, restore and migration take very little time compared to VM.
Migration - Virtuozzo for Linux can migrate a virtual environment from one machine to another live, without service interruption. No SAN storage is required. Virtuozzo will move the data over a regular Ethernet connection. After all, there is not that much data.
Start/stop time - Starting and stopping a virtual environment is very quick because the lengthy OS start-up process is not repeated.
Resource management - Virtuozzo has an advanced resource management feature, including limits and guarantees for CPU, memory, network and I/O bandwidth and disk storage space. A virtual environment is guaranteed to get resources according to the SLA.
Scalability and performance - Virtuozzo does not virtualize or emulate hardware. Also, a single virtual environment can use all resources of the machine. At last, you can now have Exchange, AD or SQL Server blades.
I hope by now you’re convinced that the ideal platform for building and running virtual appliances is Virtuozzo. Looking forward to your comments!