Virtualization
• Virtualization is nothing more than an abstraction over physical
    resources to make them shareable by a number of physical users.
  • Virtualization allows multiple operating system instances to run
    concurrently on a single computer, it is a means of separating
    hardware from a single operating system.
 A physical server on which one or more virtual
  machines are running is defined as host.
 The virtual machines are called guests.
 A hypervisor or Virtual Machine Monitor
  (VMM) is a piece of software, firmware or
  hardware that creates and runs virtual
  machines.
                        Virtual Machines
VM technology allows multiple virtual machines to run on a single
physical machine.
       App     App         App                App     App
        Guest OS             Guest OS            Guest OS   VirtualBox
         (Linux)                                (Windows)
                             (NetBSD)
             VM                  VM                 VM      VMWare
             Virtual Machine Monitor (VMM) / Hypervisor
                             Hardware
Virtualization
                     Cloud and
•                    Virtualization
    Virtual Workspaces:
     – An abstraction of an execution environment that can be made dynamically available to
       authorized clients by using well-defined protocols,
     – Resource quota (e.g. CPU, memory share),
     – Software configuration (e.g. OS).
•   Implement on Virtual Machines (VMs):
     – Abstraction of a physical host machine,
     – Hypervisor intercepts and emulates instructions from VMs, and allows management of VMs,
     – VMWare, Xen, KVM etc.                                App       App       App
•   Provide infrastructure API:                             OS          OS           OS
                                                                    Hypervisor
     –        Plug-ins to hardware/support
     structures                                                     Hardware
                                                                 Virtualized Stack
        Need a virtualization software
Only a virtualization software can "imitate" the hardware. It
manages the Virtual Machines, so we normally call it virtual
machine manager.
Open-Source virtualization software
            VirtualBox
Commercial virtualization software
            VMware workstation        –- Paid one
               Advantages of virtual machines
– Run operating systems where the physical hardware is unavailable,
– Easier to create new machines, backup machines, etc.,
– Software testing using “clean” installs of operating systems and
  software,
– Emulate more machines than are physically available,
– Timeshare lightly loaded systems on one host,
– Debug problems (suspend and resume the problem machine),
– Easy migration of virtual machines (shutdown needed or not).
–   Sandbox Does not affect anything on host OS
–   Networked
–   Resource utilization
–   Isolation/interdependence
        Virtual Machine Monitor
• The host software that provides virtualization is often referred to
  as a virtual machine monitor (VMM) or hypervisor.
• The VMM gives each virtual machine an illusion of a complete
  computer to itself.
                                                                        8
Architecture
               9
              Different types of
              Virtualization
Full Virtualization    Para-Virtualization   OS-level Virtualization
                 Full Virtualization
The hypervisor interacts directly with the physical server's
 CPU and disk space.
The hypervisor keeps each virtual server completely
 independent and unaware of the other virtual servers
 running on the physical machine.
Each guest server runs on its own OS -- you can even have
 one guest running on Linux and another on Windows.
           Full Virtualization (Contd..)
As virtual servers run applications, the hypervisor relays resources
 from the physical machine to the appropriate virtual server.
Hypervisors have their own processing needs, which means that
 the physical server must reserve some processing power and
 resources to run the hypervisor application.
This can impact overall server performance and slow down
 applications.
                    Full Virtualization
Full virtualization provides a complete simulation of the underlying
 hardware and is a technique used to provide support for unmodified
 guest operating systems.
The term unmodified refers to operating system kernels which have not
 been altered to run on a hypervisor.
While full virtualization comes with a performance penalty, the
 technique permits running unmodified operating system, which is ideal,
 particularly when source is unavailable such as with proprietary
 operating systems.
Full Virtualization
                   Para-Virtualization
The fundamental issue with full virtualization is the emulation of
 devices within the hypervisor.
A solution to this problem is to make the guest operating system
 aware that it's being virtualized.
With this knowledge, the guest OS can short circuit its drivers to
 minimize the overhead of communicating with physical devices.
In this way, the guest OS drivers and hypervisor drivers integrate with
 one another to efficiently enable and share physical device access.
Low-level emulation of devices is removed, replaced with cooperating
 guest and hypervisor drivers.
Para-Virtualization
             Para virtualization
• Pros
   • Improved Performance
• Cons
   • The downside of para-virtualization is that the guest must
     be modified to integrate hypervisor awareness
                  OS-level Virtualization
• An OS-level virtualization approach doesn't use a hypervisor at all.
• Instead, the virtualization capability is part of the host OS, which
  performs all the functions of a fully virtualized hypervisor.
• The biggest limitation of this approach is that all the guest servers
  must run the same OS.
• Examples: FreeBSD Jails, Solaris Containers.
OS-level Virtualization
              OS-level Virtualization
• Shared kernel virtualization or operating system virtualization
  takes advantage of the architectural design of Linux and UNIX
  based operating systems.
• At the core of the operating system is the kernel.
• The kernel handles all the interactions between the operating
  system and the physical hardware.
                  OS-level Virtualization
The second key component is the root file system which contains all the
 libraries, files and utilities necessary for the operating system to function.
 Under shared kernel virtualization the virtual guest systems each have
 their own root file system but share the kernel of the host operating
 system.
OS level virtualization is based on the creation of isolated containers or
 partitions on a single physical server, and the use of OS instances for each
 guest application environment to work independently of the other
 partitions.
         Applications of OS-level Virtualization
• It is an ideal approach for web hosting companies which have multiple
  virtual web servers running on a single box.
• Another example would be a company that has to manage multiple
  SQL databases or any other scenario where many similar or identical
  servers need to be hosted or managed within the same datacenter.
           Different Types of Hypervisors
• Type 1
• Type 2
                        Type 1 Hypervisor
• A hypervisor running on bare metal is called Type 1 Hypervisor or native
  Hypervisor.
• No host operating system is required, they are installed on bare metal.
• Bare metal hypervisors are faster and more efficient as they do not need
  to go through the operating system and other layers that usually make
  hosted hypervisors slower.
• Examples
   • Vmware ESX
   • Citrix XenServer
   • Oracle VM Server
                     Type 2 Hypervisor
• Installed over an operating System and are referred to as Type 2
  Hypervisor or hosted Hypervisor.
• Hosted hypervisors are much easier to set up than bare metal
  hypervisors because you have an OS to work with.
• These are also compatible with a broad range of hardware.
• Examples
   •   KVM
   •   Microsoft Hyper-V (run over Windows Server)
   •   VirtualBox
   •   Vmware Workstation
       Type 1 Hypervisor vs. Type 2
               Hypervisor
According to IBM, Type 1 hypervisors provide higher
performance, availability, and security than Type 2
hypervisors.
                Benefits of Virtualization
• Resource Pooling (thus maximum resource utilization)
• Server Consolidation (thus saving energy and cost)
• VM Migration (Refers to moving a server environment from one place
  to another)
   • Load balancing
   • Maintenance
   • Failover
• Redundancy
• Isolated machines (Useful for testing operating systems and new
  applications)
                        Load Balancing
• Load Balancing means the ability to spread the load of processing
  over a number of separate systems for an overall performance
  increase in processing incoming requests.
• It represents the ability to transfer any portion of the processing for a
  system request to another independent system that will handle it
  concurrently. Eg. Web/Database Server.