Wednesday, June 3, 2009

Server virtualization


There are three main types of server virtualization: operating
system virtualization; hardware emulation; and paravirtualization,
a relatively new concept designed to deliver a
lighter weight (in terms of application size), higher performance
approach to virtualization.



Operating system virtualization
Operating system (OS) virtualization (sometimes called containers)
runs on top of an existing host operating system and
provides a set of libraries that applications interact with,
giving an application the illusion that it is (or they are, if there
are multiple applications) running on a machine dedicated to
its use. The key thing to understand is that, from the application’s
execution perspective, it sees and interacts only with
those applications running within its virtual OS, and interacts
with its virtual OS as though it has sole control of the
resources of the virtual OS. Crucially, it can’t see the applications
or the OS resources located in another virtual OS.

This approach to virtualization is extremely useful if you want
to offer a similar set of operating system functionalities to a
number of different user populations while using only a single
machine. This is an ideal approach for Web hosting companies:
They use container virtualization to allow a hosted Web
site to “believe” it has complete control of a machine, while in
fact each hosted Web site shares the machine with many
other Web sites, each of which is provided its own container.
Operating system virtualization imposes little overhead for
the virtualization capability, thereby ensuring most of the
machine’s resources are available to the applications running
in the containers.

There are some limitations to operating system virtualization,
though. First and foremost, this approach typically limits operating
system choice. Containerization usually means that the
containers offer the same operating system as the host OS and
even be consistent in terms of version number and patch level.
As you can imagine, this can cause problems if you want to run
different applications in the containers, since applications are
often certified for only a certain OS version and patch level.
Consequently, operating system virtualization is best suited
for homogenous configurations — for those arrangements
operating system virtualization is an excellent choice.

Companies offering operating system virtualization include
Sun (as part of their Solaris! operating system) and SWSoft,
which offers the commercial product Virtuozzo as well as
sponsoring the open source operating system virtualization
project called OpenVZ.



Hardware emulation
In hardware emulation, the virtualization software (usually
referred to as a hypervisor) presents an emulated hardware
environment that guest operating systems operate upon. This
emulated hardware environment is typically referred to as a
virtual machine monitor or VMM.

The VMM provides a standardized hardware environment that
the guest OS resides on and interacts with. Because the guest
OS and the VMM form a consistent package, that package can
be migrated from one machine to another, even though the
physical machines the packages run upon may differ. The
hypervisor, which resides between the VMM and the physical
hardware, translates the calls from the VMM to the specific
resources of the physical machine.

This approach to virtualization means that applications run in
a truly isolated guest OS, with one or more guest OSs running,
one per VMM. The VMMs all reside on the virtualization hypervisor.
Not only does this approach support multiple OSs, it can
support dissimilar OSs, differing in minor ways (for example,
version and patch level) or in major ways (for example, completely
different OSs like Windows and Linux can be run simultaneously
in hardware emulation virtualization software).


Common applications for hardware emulation are software
development and quality assurance, because it allows a
number of different OSs to be run simultaneously, thereby
facilitating parallel development or testing of software in a
number of different operating system environments. Hardware
emulation is also used in server consolidation, where a
number of operating system/application environments are
moved from separate physical servers to a single physical
server running virtualization software.

There are a couple of drawbacks to hardware emulation, however.
One is that the virtualization software hurts performance,
which is to say that applications often run somewhat
slower on virtualized systems than if they were run on unvirtualized
systems.

Another drawback to hardware emulation is that the virtualization
software presents a standardized hardware interface
(the VMM) to the guest operating system. The hypervisor provides
an interface to the VMM and then translates that into
calls to the actual physical resources on the machine. This
means that the hypervisor must contain the interfaces to the
resources of the machine; these resources are referred to as
device drivers. If you’ve ever installed new hardware in a PC,
you know that you often have to install a device driver into
the operating system so that the new hardware and the operating
system can communicate.

The device driver issue for hardware emulation is that the
hypervisor contains the device drivers and there is no way
for new device drivers to be installed by users (unlike on your
typical PC). Consequently, if a machine has hardware resources
the hypervisor has no driver for, the virtualization software
can’t be run on that machine. This can cause problems, especially
for organizations that want to take advantage of new
hardware developments.

Companies offering hardware emulation virtualization software
include VMware (in two versions, VMware Server and
ESX and ESXi Server) and Microsoft, which offers a product called
Microsoft Hyper-V Server 2008. Another possibility
is Xen, a hypervisor-based open source alternative.



Paravirtualization
Paravirtualization is the name for another approach to server
virtualization. In this approach, rather than emulate a complete
hardware environment, the virtualization software is a
thin layer that multiplexes access by guest operating systems
to the underlying physical machine resources.

There are two advantages to this approach. First, it imposes
less performance overhead because it is a very small amount
of code. Hardware emulation, you’ll recall, inserts an entire
hardware emulation layer between the guest operating system
and the physical hardware. By contrast, paravirtualization’s
thin software layer acts more like a traffic cop, allowing one
guest OS access to the physical resources of the hardware
while stopping all other guest OSs from accessing the same
resources at the same time.

The second advantage of the paravirtualization approach
compared to hardware emulation is that paravirtualization
does not limit you to the device drivers contained in the virtualization
software; in fact, paravirtualization does not include
any device drivers at all. Instead, it uses the device drivers
contained in one of the guest operating systems, referred to
as the privileged guest. Without going into too much detail
about this architecture here, suffice it to say that this is a benefit,
since it enables organizations to take advantage
of all the capabilities of the hardware in the server, rather
than being limited to hardware for which drivers are available
in the virtualization software as in hardware emulation
virtualization.

It might seem that paravirtualization would be the way to go.
However, there has been one significant drawback to this
approach to virtualization: Because it is lightweight and multiplexes
access to the underlying hardware, paravirtualization
requires that the guest operating systems be modified in
order to interact with the paravirtualization interfaces. This
can only be accomplished by having access to the source
code of the guest operating system. This access is possible
for open source operating systems like Solaris and Linux,
and is only possible for Microsoft operating systems with
Microsoft source code access. The good news is that Quad-
Core AMD Opteron! processors featured within Sun x64 systems
provide functionality that enables unmodified operating
systems to be hosted by a paravirtualized hypervisor.
Consequently, this drawback to paravirtualization will diminish
as servers with these new chips take their place in production
infrastructures.

One example of paravirtualization is a relatively new open
source product called Xen, which is sponsored by a commercial
company called XenSource. Xen is included in the recent
Linux distributions from Red Hat and Novell, as well
as being available for many community Linux distributions
like Debian and Ubuntu. XenSource itself sells Xen-based
products as well. Another possibility is Virtual Iron, a
Xen-based solution.

No comments:

Post a Comment