TimeLinux1

Monday, April 18, 2011

Linux: OS Basics - 3

... continued ...

Virtualization:

-Virtualization is the concept of running multiple OS simultaneously on one physical hardware.
-virtualization was attained originally on IBM VM370 in the late 60s but had been fairly nascent for almost 40 years.
-This was primarily due to the way the Intel chips were designed.
-They fixed it in 2005 in the so-called VT (virtualization technology). AMD also did so around the same time.
-This was bec, in recent times due to business needs, there was a renewed interest in virtualization.

-In virtualization, the hardware is abstracted by a piece of software called hypervisor.
-hypervisor is sometimes also called 'virtual machine monitor'.
-The hypervisor creates multiple abstract copies of the hardware that can co-exist in isolation.
-in a virtualized env, the hypervisor is the only s/w running in kernel mode.
-hypervisors can be of two types: type 1 hypervisors and type 2 hypervisors.
-type 1 hypervisor - runs on bare metal. Abstracts complete hardware.
-type 2 hypervisor - runs inside a host os. All guest os system calls are channeled through host os.
-type 2 hypervisors were a way to bypass the shortcomings of Intel chips until VT came along.
-VMware was a pioneer in popularizing type 2 hypervisor that came out of a research work at Stanford Univ.
-as the technologies evolved, both type 1 and type 2 hypervisors exist now.
-there are no real merits or demerits of either of the above types of hypervisors.
-both have their own strengths and weaknessess.

-most failures happen not due to hardware but due to buggy software--esp the os.
-in case of a virtual machine, the hypervisor is the only s/w running on baremetal.
-and the hypervisor has much fewer lines of code than a full os--ie lesser bugs.
-this is why, virtualized envs are generally fault-tolerant.
-benefits of virtualization include lower tco--lower cost, reliability, manageability etc.

-in a virtualized env, the hypervisor is the only s/w running in kernel mode.
-the hypervisor fools the overlying os by creating the illusion that the os is running in kernel mode.
-in reality, the os runs in user mode only and depending on the hypervisor for h/w access.
-all sensitive instructions issued by the guest os are turned into system calls to the hypervisor.
-the hypervisor executes them on the real h/w. the guest os never actually interact with h/w.

-in neither type 1 or type 2 hypervisors does the guest os need to be modified in any form.
-paravirtualization is a special type of virtualization in which the guest os is modified to make hypervisor calls.
-in this, the guest os is said to be para-virtualized.
-the difference in traditional vm (type 1/2) and paravirtualized is that:
    . in the former guest os makes calls to hardware via the hypervisor--ie it has to know the hardware.
    . in the latter guest os makes calls to hypervisor & the hyp then makes calls to h/w--ie guest os doesnt know h/w.
-paravirtualized guest os usually has better performance compared to full virtualization as it doesnt have to make calls to the h/w.
-a common example of paravirtualized hypervisor is Xen.

... now we are at a point where we can discuss Linux in a greater depth..

No comments:

Post a Comment