Introduction to Virtualization - 101

Virtualization and Cloud Computing are both very hot topics and are definitely changing computing as we know it.   I have been investigating virtualization for over a year now and wanted to share some of my insights which are rarely found in one spot, nor in plain language.   So the time is now! Give it a try: Sun Virtualbox, Xen, KVM - all are good.

Virtualization is not new.  IBM pioneered it with "vm" and "cms."  IBM has had it in AIX with their "lpars" for years.  But how many of us have seen that?  However, today, with a modest time investment (about 1/2 day) and modest hardware (a dual core cpu with 4Gb RAM) you can see and get a feel for what people are talking about.

Usually today when people mention "Virtualization" they are talking about one of the following packages that will present virtual hardware:
VMWare ESX / Citrix XenServe - generally out of many people's price range.
VMware Workstation / Parrellels - not too pricy, but expensive enough to deter most.
VMWare Server / KVM / Xen / Sun VirtualBox / - these you can use for free.

The reason that Virtualization is the gateway to cloud computing is that although one could build a cloud w/o virtual machines - it would be too expensive to maintain all the real machines - and the virtualization technology makes it so much easer to make a machine, start it, stop it, back it up.

For general reliablity and ease of use I would suggest Sun VirtualBox to get started.
It is "free as in beer" .. and just works.

Sun VirtualBox is made for Desktop virtualization:
This means that the virtualization of I/O is good enough to watch a Movie run from the virtual machine.
It means that Sun VirtualBox  hasn't had the test milage as much as the server vm machines.
It also means you have a chance of getting everything running correctly.

The general idea behind all these virtualization tools is that you take a base - often called the "Host OS" (in our case Linux or Windows or MAC OS), then you run one or more instances of another operating system as a "Guest OS" (in our case, Linux or Windows).

And for me it was such an "ah-ha!" moment.  When you do it, I hope it will be the same for you.
To see full Operating System Environments running around like applications on your desktop.  Wow.

But what does that  mean?

Well, it gets you away from Hardware Lock in, at the cost of Virtualization lock in.

In the old days, you could image a machine and move it over to another.  Many Mac users can still do this.But more and more, in the Windows world and in the Linux world you cannot.  Video cards, network cards, odd chipsets. . .. all cause grief.

These systems provide a nice GUI to get started, and later, not bad Command Line tools to automate starts, stops, and clones.

Virtualization provides a "good enough" set of hardware - and makes a bridge over to the real hardware.
So you are not running optimially, but you get several advantages.

  • to copy the hard disk - just copy the file in which the vm lives.
  • clone the disk - run the cloning tool - this gives the disk a new uuid.
  • clone the vm - run the tool to make a new vm (this gives all hardware a new uuid, then attach one of those cloned virtual disks)
  • backup: pause the vm machine and copy the file.  or use Linux LVM.

Your people like to put one service on one machine - let them do it as one service per one virtual machine, then move the VMs around.

So If you are someone who just surfs the net, then this really isn't for you.

But here are some examples building up from single user, to company, to enterprise:

1. Lots of Desktops

Windows on MAC:  The MAC people often will build a Windows virtual so they can have real Microsoft Office, especially Microsoft Access (sigh).

MAC on other systems:  I have seen it, but currently it is illegal, and very difficult, to have a MAC virtual (sigh sigh)

Another scenario:

Say you are a Web Developer.  You have to test your web site in Firefox 2, Firefox 3, IE6, IE7 and IE8. Or, you are a Program Developer. You have to test your application with Java 1.4, Java 1.5 and Java 1.6. Under Windows - you can run only one version of these programs at a time. and installing/removing is troublesome and error prone. So, How are you going to do that?  It takes about 1/2 to 1 day to get a workstation or server up running with all the tweaks; to get it exactly the way you like it.

Then when you are ready:

  • Clone it - Takes about 5 mintues+ each to clone out 5 workstations as in the above example.
  • Take a few minutes to put what you need on the system - in this case browsers, Java,.NET, etc.

2. Workstation / Server

Say you have windows on your laptop.  You support a Linux Drupal site.  You want to try your changes locally, then deploy.  With virtualization - just spin up a copy of a Drupal site, run it on the laptop. Access it either as if it were off-site or access it through the nice handy window.

Also, you allow for 40Gb disk - but the system only uses 8Gb to start and it can grow as you need it, or you you need rock and roll performance - pre-allocate the 40Gb.

Your server can run behind NAT and you can play port forward tricks, or it be a full host on the network. (see  bridged networking)

More handy tricks:

  • Add RAM - just pause the machine - change the RAM amount - restart.
  • Add another disk - pause the machine - attach a virtual disk - start.
  • Network cards: 100Mb or 1000Mb - up to 4
  • Add another cpu - just click the option - the rule of thumb is to assign to the vm at least one core and no more than (max cores in the real machine)-1
  • Some tools let you resize the disk - but then the Guest OS must handle it, which it can with some before hand prep.
  • Generally every hardware can be increased.

A really nice step up is to send the OS image out to the service provider (Internal or External).

3. Say you run a software shop:

Get the "build machine" going on a virtual.  For example, Fred and Suzie each need their own copy for special work--clone them each one. No sweat. About 5 min of work, plus some tweaking.

Also This will make backup/restore much easier. Also if it runs slow - clone it, move it over to another machine. now you have two.
Some larger software shops have a build cloud - a developer checks one out like a library book.

3. Server Deployment

Say you want to create a little "High Availabilty" environment:  two Web servers, two DNS servers, two Database servers.  In the old days, for security, reliability, for easy of maintanence, many would advocate using six real machines. Ouch.  This is the scenario that often is in the news.  However with VM, you can make each server/service exactly the way you want it. then clone it.  Then prune down the amount of RAM and other resources to their minimum.  Increase as necessary.

Perhaps you can put this all on two real machines.  If one gets bogged down, buy another real machine.  if one dies, fix it, and redeploy.

4. Upgrades

You want to pick up the latest fixes, or try a program.  Make a snapshot (in Virtual box, you must pause the system first), restart, apply, if disaster, pause, revert, if good, pause, accept.

Now, as seen above, you can start small with your laptop or desktop.  You can grow to a 10,000 server datacenter!  A bank I know locally starts with putting five virtual machines on each real machine, then thins as necessary.

5. The Cloud

A cloud can exist in your own building. Of course Amazon, Google, and others want to sell you time on theirs.

See how these virtualization/deployment schemes work in the cloud?

  • You want a machine - fill out the gui and poof - a virtual machine!
  • You want some software -- fill out the form, and they will populate it for you.  You and yours tweak it as necessary.
  • Start, stop, backup and clone is much as discussed above.
  • Monitor you bandwidth by hand or with scripts.  stop and start as necessary and as you can afford.

5. OUTSOURCE with Care

If you made it this far, one of the things often NOT mentioned is that if you are a decision maker and want to outsource your computing, it is often discussedthat it is "EASY" to outsource, then bring it back in house, "if you need to."

Many of us would beg to differ.  Once you lose the people,  it will be come very difficult to bring that work back in house.  There is often much more company operational knowledge in those people's heads than is often accounted for in a cursory look.

To finish: a good sample article from  "the big kids:"
http://www.forbes.com/2010/02/20/virtualization-ibm-microsoft-technology-cio-network-emc.html

Enjoy,

Stephen