Nowadays Virtualization is the most trending topic in IT industry and it’s a skill that is expected from every IT employee. What is Virtualization and why it’s so important? Read on to know everything about Virtualization and how it can be a useful skill for software testers.
As wiki says,
Virtualization, in computing, refers to the act of creating a virtual (rather than actual) version of something, including but not limited to a virtual computer hardware platform, operating system (OS), storage device, or computer network resources.
With growing technology and demand, virtualization technology has been expanded from Hardware and Software virtualization to Memory virtualization, Storage virtualization, Data virtualization and Network virtualization. Every scope of virtualization has its own specification.
For this article, we are concentrating on Hardware Virtualization, the most basic and most needed virtualization technique in software testing field.
Computer hardware virtualization is the virtualization of computers or operating systems. In simple words, on single physical hardware, when single or multiple virtual computer environments can be created and each of them can be used as an independent computer, it's called platform virtualization.
Under Hardware/Platform virtualization, three types of virtualization are included:
- Full Virtualization: Full virtualization helps in virtualizing the main physical server so that different application and software can be supported. Full virtualization allows the flexibility to combine existing systems on to the newer ones with increased efficiency and a well-organized hardware. The technique enables the administrators to run unchanged and entirely virtualized operating system.
- Partial Virtualization: This method simulates the underlying hardware configuration for the virtual machines being created. The key factor for partial virtualization is address space virtualization, where each virtual machine consists of independent address space. This method is easy to implement and provides useful and robust virtualized environment.
- Paravirtualization: This virtualization technique is a kind of enhancement of virtualization technology, where OS to be installed as guest OS is reconfigured before installation inside the virtual machine. Thus, this method runs modified versions of operating systems. Using this technique, the guest is very well aware of its environment as the paravirtualized OS is altered to be alert about its virtualization
In today’s world, many solutions for virtualization are available which could be used by users as a freeware. To list down few of them: VMware Player, Sun Virtual Box, Oracle VM manager, Microsoft Virtual PC etc. All these virtualization solutions can be installed on your local desktop machine or laptop.
How Virtualization technique is useful and advantageous for testers:
On one physical machine, only one Operating System can be installed.
Consider an example: Initially, as per the test plan, the application needs to be tested for RHEL 6.1 and SLES 11.2. After first primary release and looking at the demand of the application, management decides to expand support for other distros of Linux like Ubuntu, Fedora, and Mint. Also, a long-term plan is to develop the same application for windows platform too.
Looking at the scenario, initially, when only two Operating Systems were supported, it was easier to create a test environment using multiple physical machines. But what happens when you have to test different versions and distros and expected to work on 50 machines (with different configurations) on daily basis?
Creating, maintaining and monitoring the huge test environment is a tedious task and time consuming too. And this is where virtualization comes in picture. Virtualization surely makes life easier by allowing deployment of multiple Virtual Machines (VMs) on a single physical machine. In addition to that, some of the main features of virtualization make it more advantageous.
Before moving ahead with pros and cons of virtualization, let‘s get an idea about points to be considered before configuring a virtual machine and how to configure it.
What You Will Learn:
Points to Consider before installing Virtual Machine (VM):
- Decide which applications you are going to install on your virtual machine. According to that install 32 or 64-bit Operating system in VM. Some applications are not compatible with old operating systems. E.g. If you are going to use UFT 12.01 it doesn't work with Windows XP. So you should install higher version of Windows to work with UFT. Check OS compatibility of your required application before proceeding with operating system installation.
- Is your Processor supports Virtualization? Almost all of the new processors support virtualization but it is a good idea to check manufacturer's website to know the details. E.g. Intel Pentium Dual Core T2390 processor doesn't support virtualization for a 64-bit operating system. So, in that case, you should install 32-bit operating system compulsory.
- VMWare also provides a trial period. So you should have a key or serial number to keep using it further.
We are going to use VMWare Virtualization software for demonstration.
Steps to install and configure VMWare:
#1) Download VMWare workstation trial version setup file from here. Set up is around 307 MB. Currently, version 12 is available. Please note we have set up screens on version 11.
#2) Install VMWare on your machine. Setup is simple and requires to click Next button couple of times.
#3) After installation open VMWare workstation by using either start menu or shortcut created on the desktop.
#4) Click on “Create a New Virtual Machine”.
(Note: Click on the image for enlarged view)
#5) With default “Typical” selected click on Next button.
#6) Specify the path of the operating system set up file.
#7) In the Next step you need to specify a Key or a serial number of operating system. If you are using trial version then that part can be skipped.
#8) Enter the name for the virtual machine and specify a path to the directory where you want to create your virtual machine. It is recommended that the drive you’re selecting to install virtual machine should have sufficient space.
#9) Specify an amount of disk space you want to allocate for a virtual machine. Allocate disk space according to the size of software you are going to install on the virtual machine.
#10) On the next screen it will show configuration you selected for a virtual machine.
#11) It will allocate Hardware according to the default settings but you can change it by using Customize Hardware button in the above screen.
You can specify what amount of RAM, a processor has to be allocated for a virtual machine. Do not allocate complete RAM or complete Processor for a virtual machine. Also, do not allocate very less RAM or processor. Leave default settings or allocate in such way that your application should be able to run on the virtual machine. Else it will result in a slow virtual machine.
#12) Click on the Finish button to create the virtual machine at the specified location and with specified resources.
If you have specified a valid file (.iso, .rar., .nrg) for the operating system it will take standard time to complete operating system set up on the virtual machine and then it will be ready to use your regular OS.
- If you didn't specify any operating system while creating the virtual machine, later you can install it just like we do for your laptop or desktop machines. We can use CD/DVD or USB devices like Pen Drive or even set up a file on the disk to install the operating system in the VM.
- If your CD/DVD drive is not working then also it is very simple to install the operating system. Go to VM -> Settings – > select CD/DVD -> in the right half select radio button for ‘use ISO image from' and specify the path on your hard disk where the .iso file is placed. This location will be treated as CD/DVD drive of your machine.
- Make sure correct boot order is specified in BIOS so installation will start while getting VM power on (in this case guest OS is not installed).
Passing data between host and VM:
Generally, VM is having its own drive and it is not showing drives from host OS in the VM environment. Also, VM drive cannot be used from host OS.
There are few options using which you can use data from Host OS in VM.
Option #1. Using shared directories: Go to VM -> Settings -> Options -> Shared Folders: add the path of the required directories which you want to view in the VM.
Option #2. Using USB devices: When USB devices are plugged in those are default available for host operating system and won't show in the VM. To make them available in VM do:
VM -> Removable devices -> mouse hover USB device and click Connect (Disconnect from the host). Now USB device will be available in the Guest OS (VM) but won’t be available in the host machine. Do reverse action to make it available in the host machine.
Advantages of virtualization
Working in the storage domain and testing disaster recovery product for almost all the years of my career, I am a huge fan of virtualization because:
- Virtualization allows creating a full-fledged, cost-effective test lab, which might be almost impossible without it.
- With a clone, snapshot and migrate features, it’s easy to create a copy, revert back to the fresh environment and carrying a virtual machine and all these means, server provisioning can be faster and up-time can be increased effectively.
- Saving in terms of space, energy, and resources.
With Advantages are seen above, there are also few points to remember:
- If we need to store multiple VM images, then there would be a need of storage space for which we need huge capacity storage box. For E.g.: NAS (Network Attached Storage box) which would be an additional cost.
- Even though VMware provides High Availability feature, the guest OS would anyway go for a reboot.
- If a user has deployed VCenter: The maximum limit for hosts are 1000 i.e. Host per VCenter.
- Virtual Machines Powered on per VCenter Server is 10000.
- Number of Registered Virtual Machine per VCenter Server is 15000.
- Number of host per data centre is 500 for VCenter Server
- In Cluster and Resource pool, the maximum limit for hosts are 32
- Virtual Machines Powered on per Cluster is 4000
- Virtual Machines Powered on per host is 512.
Overall, virtualization permits a flexibility in terms of hardware deployment and configuration and the most needed skill to perform a task successfully.
What’s your opinion? Do you use VMWare or any other virtualization software? Let us know your tips and tricks.