Sunday, June 3, 2007

Welcome to Virtual World (Server Virtualization)

lets start with some technical stuff....

sometime back I started working on one of the popular Virtual Machine Monitor(VMM) / hypervisor called xen. Basically there are various kinds of Virtualization like 1) Virtual Memory 2) Linux IP virtual Server 3) Application Virtualization 4) Server / Software Virtualization out of which xen does the last i.e. Server Virtualization.

Let’s see some of the basic terms in Server Virtualization.
Virtual Machine (VM) – This is an artificial environment created which simulates all the hardware resources needed by an operating system. The OS running in such environment is called as guest OS. Guest OS has a virtual view of the underlying hardware.
Virtual Machine Monitor (VMM) / hypervisor – This is the interface between the guest OS and
underlying hardware. Through VMM all the administrative tasks like adding a new guest OS,
allocation of resources to each of guest OS is done. Some examples of VMM are – Vmware, Xen
Host OS – The native OS running on the given hardware is called as Host OS. The VMM is
installed on Host OS. This OS has all the privileges on given hardware. We can have VMM running directly on hardware without any host OS which is called as Bare Metal Environment.

In simpler terms, the actual physical resources are divided into logical partitions. Each of the
logical partition is allocated to some guest OS. Each guest OS runs independently on given
partition. For Host OS, guest OSes are like the normal processes running on it. But with a major
difference that every guest OS has resource guarantees. This is the similar case as that of real
time systems where resource guarantees are associated with the processes.

Capabilities of Virtual Machines

  • Workload Isolation or Workload Consolidation
  • Workload Migration
  • OS debugging
  • Running Legacy Applications
Types of Virtualization
These types are based on the nature of guest OS.
Para-Virtualization: In this scenario, Guest OS requires some modification to run in
Virtual Machine environment. Reason behind this is that the OS are made with
assumption that they are having all privileges on the hardware. But in case of Virtual Machines, guest OS doesn’t have rights to run all the privileged instructions on the given
hardware. So to resolve this case, there are two alternatives. One is to have support from
processor, otherwise change the privileged part of code(which possible in open source OS only). Guest OS runs in ring 1 of x86 family processors which do not support virtualization.
Full Virtualization: In this type, unmodified OS can run in Virtual Machine. This is
actually achieved by any of the following two ways. One way is Hardware (processor) support for Virtualization. X86 family started give support from Intel-VT & AMD-V which released in 2005 and 2006 respectively. Other way is Binary Translation the one adopted in VMware. Vmware tries to track the all the instructions issued by guest OS & whenever a privileged instruction comes in, VMware translates it. But some people argue that this is a costlier solution.

this was just overview of world of Virtual Machines (hereafter we'll use this term. don't confuse it with Java Virtual Machines)

Any queries and/or suggestions & clarifications about any mistake I done while writing are most welcomed ( rather I will say reply is MUST :) )

2 comments:

praseidimio0904 said...

In addition to Xen and VMware I have used zones in solaris.

Zones as the name suggests divide a running system into independent parts each behaving as an OS and you can configure different attributes of a zone.

You can install different servers on different zones say apache on one and oracle on the other and guarantee the Qos(see gundecha's blog) by fine tunning the attributes.

Only bad thing is that you can create only Solaris zones on Solaris OS..you can not install another OS on the zone. I am not sure to which category of virtualization it will belong to :(

A lot of other varients/implementations listed at:

http://www.kernelthread.com/publications/virtualization/

Rahul said...

zone is solaris container which is implementing operating system-level virtualization. As Karshan already told, every application runs inside a virtually isolated enironment where it is unaware of other applications running on same OS. (Same OS kernel is used to implement the "guest" environments. )

Other examples are Parallels Workstation, Parallels Desktop for Mac, FreeBSD Jails, Virtuozzo , OpenVZ,Linux-VServer.