The other uses of Virtualization.
Everyone agrees that virtualization is very useful for running corporate data centers as it not only reduce energy consumption but also helps scale the applications in an efficient way.
Disaster recovery and High Availability are others reason everyone use virtualization. Furthermore cloud/distributed computing is best use of virtualization. This post is not about the above applications. There are a lot of posts and white papers on the web to talk about the applications of virtualization in the above areas. This post is about the other uses of virtualization : standardizing development environments, helping kick start new team members with their development environment , restoring our workspaces in case we mess it up
and perhaps the best use is in scaling up our test automation and/or stress/load testing efforts just before major releases.
Every project has a set of tools which needs to be installed and configured in a particular way before a developer starts contributing to the project. Many times it takes a day or two for a new hire to join a company and setup all the needed tools. In some projects all the steps are documented and in some other projects these steps are not documented. The new hires would just have to figure out by asking others or by just trying a couple of ways before arriving on the best practices for that project. As we all know, many developers do not like documenting and fail to do it many times :). If we use a virtual machine(VM) as part of our development environment and install and configure all our tools on the VM, it will save a lot of time
and frustration for new team members. This will also ensure that everyone is following the best practices. All without even a single line of the dreaded documentation!
To illustrate this lets take the example of a web development project. Many people use eclipse for doing web development. Every time a new plugin is released or some new frameworks are out the developers are eager to try them. During those times, they end up updating eclipse or doing some other environment changes. Sometimes this has side effects, i.e. out main project stops working :(. To revert all the changes they just did will again cost them some time. It happened to me also number of times. In case we use a virtual machine as our development environment, if anything goes wrong we will stop the current VM(well after checking in all the code needed) and then just boot the baseline copy virtual machine and we will be all set.
If we are using ESXi we can take a snapshot and do our experiments. If anything bad happens in the experiments we can just go back to the snapshot.This logic can be applied to a large variety of projects ranging from embedded systems to enterprise applications.
Another very good use of virtualization is in testing. Before every major release (we can extend the logic to every release ) we have run a lot of tests. If a company uses test automation and has tests which would take 7-8 days to run the entire suite then by using virtualization we can just create 7-8 copies of the testing virtual machine. Then run all the tests in parallel in just one day. After our tests are run, we can shutdown all the unnecessary testing VMs(virtual machines). Doing this would save us a lot of money i.e. both the cost of buying new hardware
and of maintaining it. For instance in one my recent project, we used selenium, testng and Java to do test automation. We had installed all the tools we needed to develop and run the test cases on a virtual machine. Our test suite currently takes approximately 24 hours to run. We used 3 virtual machines to run the tests overnight. This helped us save a lot of time.
Another use of virtualization is during stress testing, soak testing and load testing. To test any appliance/web appliance or a website, we need a lot of stress testing. Most of the times this is just one time thing, just before the main release. We try to simulate real life scenarios using a large number of simultaneous client connections to our server. For a bank website we probably have to simulate more than a couple of thousand request at any given point of time. We can use the power of virtualization to scale up our stress/load/soak testing. Once we are done, we can shutdown all those test virtual machines. In this economy reducing cost while doing thorough testing is definitely going to impress your boss.
As we are done with the uses, now i would like to talk about some virtualization tools i used and like. All of them are free and are by VMware. Googling the names will give a lot of tutorials so i am skipping that for now.
VMware ESXi (vSphere Hypervisor) : This is a more efficient way to run VMs. If you need better performance this is the tool which needs to be installed. In this case the VMware OS(ESXi) has the full control of hardware and then passes it to the installed OS inside the virtual machine.
VMware vSphere Client: This is used to connect to ESXi or vCenter.
Here is a link for the full set of tools from VMware: http://www.vmware.com/support/
VMware is the only vendor in virtualization, but it is the most popular one. Other VM major vendors are:
Citrix Systems XenServer: http://www.citrix.com/English/ps2/products/product.asp?contentID=683148
Sun Virtual Box : http://www.virtualbox.org/
Microsoft Hyper-V : http://www.microsoft.com/virtualization/en/us/default.aspx
Open Source xen: http://www.xen.org/
In summary, i think that the uses of virtualization are way beyond its current applications. Scaling and risk mitigation would still be the major uses but nevertheless
the other uses are also important. All the articles on the web just talk about how virtualization is useful for saving money for companies, its uses for a developer and tester have been ignored. Also using virtualization we can do things which we probably never did before. Ex:- Scale a load test to a very large number.
Bottom line: Virtualize, Scale and Go Green!
Disclosure: I currently own the stock of VMware and Citrix.