In computing, virtualization refers to the act of creating a virtual(rather than actual) version of something, this includes virtual computer hardware, virtual storage devices and virtual network resources.
A simple example of virtualization is when you create partitions in your hard disk. Here you are not actually breaking your hard disk into pieces but virtually you are creating that many partitions of it.
This video explains it all about the levels of Virtualization.
Levels of Virtualization
Virtualization at Instruction Set Architecture(ISA) level
- Every machine has an instruction set .
- This instruction set is an interface between software and hardware.
- Using this instructions software can communicate with hardware.
- So when virtualization is carried at this level, we create an emulator which receives all the instructions from the Virtual machines, like for example if a virtual machine wants to access the printer then that instruction will be passed to this emulator,
- The emulator will then interpret what type of instruction it is and then map that instruction to the Host machine’s instruction and then that instruction will be carried out on Host machine and the results will be passed to the emulator and emulator will return it to the virtual machine.
- This technique is simple to implement but as every instruction has to be interpreted before mapping it, too much time is consumed and performance becomes poor.
Virtualization at Hardware Abstraction Layer(HAL) level
- As in Virtualization at ISA level, performance is reduced due to interpretation of every instruction so to overcome that we have virtualization at HAL level.
- In this type we map the virtual resources with the physical resources.
- We don’t interpret every instruction but we just check whether it is a privileged instruction or not.
- If the instruction is not privileged we simply allow normal execution because already virtual and physical resources are mapped so accessing is simple.
- But if the instruction is privileged, we pass the control to VMM(Virtual Machine Monitor) and it deals with it accordingly.
- There may be many Virtual machines running simultaneously on the same Host system so if privileged instructions like memory management or scheduling tasks aren’t handled properly, system can crash.
- Even after many advancements still there are certain exceptions which cannot be caught by this method which is a drawback of this type of virtualization.
Virtualization at Operating System(O.S.) level
- In virtualization at HAL level each virtual machine is built from scratch i.e. by installing O.S., application suites, networking systems, etc.
- In cloud sometimes we need to initialize 100 Virtual machines at a single time, If we use virtualization at Hardware abstraction layer(HAL) level this can take too much time.
- So to overcome this in Virtualization at Operating system level we share operating system between Virtual machines along with the hardware.
- So we keep the base O.S. same and install only the differences in each single Virtual machine.
- For example if we want to install different versions of windows on virtual machines(VM), you keep base O.S. of windows same and only install the differences among each VM.
- A drawback of this type is that you can install only those O.S. in VMs whose parent O.S. family is same like for example you can’t install ubuntu on a VM whose base O.S. is windows.
Virtualization at Library Level or Programming language level
- When developers develop certain applications, they save the user from all the coding details by providing them Application User Interface(API).
- This has given a new opportunity for virtualization.
- In this type, we use Library Interfaces to provide a different Virtual Environment(VE) for that application.
- In short we provide user with an emulator with which user can run applications of different O.S.s.
- Example of this is the WINE tool which was used mostly by mac users to play Counter Strike 1.6 game which was only available for windows in the start.
Virtualization at Application Layer level
- In this kind of virtualization Virtual machines run as an application on the Host operating system.
- We create a virtualization layer which is present above the Host Operating system and it encapsulates all the applications from the underlying O.S.
- While all the Applications are loaded, Host O.S. provides them with a Runtime environment. But virtualization layer replaces a part of this Runtime environment and gives a Virtual Environment to the Virtualized applications.