Sunday, December 4, 2011

Server Virtualization

In my last blog I talked about Cloud Computing. Those who read that will know that a Cloud provides computing resources on the fly. These resources can be software resources like a CRM Solution, an Email Solution or a BI Solution or they can be hardware resources like storage. They can also be complete machines/servers with everything setup. This is what Amazon EC2 does. What this means to you as a user is now you can get a server machine of your choice on demand. So you can say that you want a machine with 2 processors, 360G storage space and 4G RAM etc. You can also say that you want Linux with MYSQL or WIndows with Oracle and Tomcat installed.

Now obviously it is not possible that when you put a request for an all set machine somebody will be available to react to your request and on getting the request he/she will set up your machine, install the required software and then provision the machine. This process needs to be on the fly and automated. So what can be the way?

One way is to keep a disk image ready which includes the standard Operating System and some standard software. You remember that Nortorn Ghost Image. Ghost is a disk cloning S/W which allows you create an Image of a disk which you can restore on another blank machine. This type of provisioning is called as Bare Metal Provisioning. Now when you ask for a machine this image can be loaded into a physical machine and that’s it.

But would this approach work with Cloud Computing? I would say NO. Why? Many reasons.
First of all this is slow. Imagine every time a ghost image getting retrieved. Moreover what do we do when the user says now I don’t need the machine anymore? Do we format the disk?
Above that, if we start giving physical machines to a user on the fly just imagine how many physical machines it would need. Too many, resulting into too much of power consumption; generating too much heat and needing too much physical space.

Also we don’t know what the Users’ Software might do to the machine. The system might crash; one erroneous program might halt the machine as there is no controlling entity.
Above all, this is not the best utilization of the resources also. Most of the time a powerful machine given to a user might be sitting idle or may be its full power won’t be in full use. If there could have been a way to share a machine among many users, it would have been a better utilization of resources. So what is the solution?

Why not have multiple machines on a single machine and allocate these smaller machines to the users. This is called server virtualization or just Virtualization.

Virtualization lets you run multiple machines or multiple virtual machines on single physical machine, with each virtual machine sharing the resources of that one physical machine. Different virtual machines can run different operating systems and applications on the same physical machine. What is a virtual machine?

A virtual machine is a software container that can run its own operating system on a physical machine. A virtual machine, just like a physical machine, has its own virtual Processor, Storage, Memory and NIC. Typically these virtual resources are implemented over actual physical resource with a software layer on top of it. So for example a virtual processor might map to a core of a physical processor. Virtual storage or memory might map to a part of physical storage or memory. Normally, Physical Machine is called as Host and Virtual Machine is called as Guest. Neither the software running on the virtual machine nor the users using it can really differentiate it from a physical machine. These Virtual machines are physically files; meta and data files, on the disk. You can collectively call those files as images and when we say that we are launching a virtual machine what we are doing is we are launching a virtual Instance from a physical image.

Now here you need to understand an important concept or benefit of Virtualization. What it is allowing you to do is separating OS from the Hardware. So Virtualization is creating a disconnect between the OS or APPs from the physical hardware and now your virtual machine sits on top of the physical hardware. So without Virtualization if you had to switch your server on a better Hardware machine it could take almost 24 hours. You take back up of your data then set up a new machine. Install same OS and other applications and then deploy your backed up data. With Virtualization it is as simple as copying the image and launching an instance out it on desired Hardware.This happens through Virtualization Software.

Let us try to understand Virtualization Software. There are two types of Virtualization Software :

1. Client based
Here you install an OS over your Hardware and over the OS you install a Client. Now you can deploy or install multiple virtual machines/OSs over that Client.

Examples:
Oracle/Sun Virtual Box
VMware Fusion for Mac

2. Hypervisor based

Typically in this case you have two components:

Hypervisor or Virtual Machine Monitor:

This is just like an OS that you install directly over Hardware. So you don’t install any OS but you put directly this component over hardware. In VM Ware world this hypervisor is called as ESXi. Hypervisor doesn’t do much alone.

Management Software:

For creating VMs you use another piece of software called as management software which in VMware world is vSphere. You install vSphere on a machine which is connected to Server/Hypervisor through Network and now you administer your server through machine. Now through vSPhere you can create VMs. You specify the Harddisk, RAM per your requirements and then install the File System and OS on it.Through management software you can also transfer this image to any Hardware which has this hypervisor installed. VMWare even allows feature like VMotion which enables the live migration of running virtual machines from one physical server to another with zero downtime.



Now a days you also get P2V tools allowing Physical to Virtual migration. So they can literally create a virtual machine image for a physical machine.
Examples:
Vmware Convertor


Acknowledgements:


http://www.youtube.com/watch?v=QYzJl0Zrc4M&feature=related

by Eli The Computer Guy