1 of 39

�Chapter 3 – Virtualisation�

1

9/6/2024

2 of 39

Virtualization

  • It basically allows one computer to do the job of multiple computers, by sharing the resources of a single hardware across multiple environments
  • It is the process by which one computer hosts the appearance of many computers

2

9/6/2024

3 of 39

Virtualization

It is the ability of a computer program or a combination of software and hardware—to emulate an executing environment separate from the one that hosts such programs.

    • For example, we can run Windows OS on top of a virtual machine, which itself is running on Linux OS

It is the process of creating a software-based (or virtual) representation of something rather than a physical one.

  • Hardware virtualization, which plays a fundamental role in efficiently delivering IaaS solutions for cloud computing
  • Virtualization can be available in many flavors by providing virtual environments at the
    • operating system level,
    • the programming language level, and
    • the application level.
  • Virtualization technologies provide a virtual environment for not only executing applications but also for storage, memory, and networking

3

9/6/2024

4 of 39

Motivation for Virtualization

  1. Increased performance and computing capacity
  2. Underutilized hardware and software resources – Due to
    • increased performance and computing capacity,
    • the effect of limited or sporadic use of resources
  3. Lack of space
  4. Greening initiatives
  5. Rise of administrative costs

4

9/6/2024

can be resolved using server consolidation

5 of 39

3 Components of virtualized environments

    • Guest :
      • represents the system component that interacts with the virtualization layer rather than with the host
      • represented by a system image comprising an operating system and installed user applications using which users interact with system resources.
    • Virtualization layer :
      • is responsible for recreating the same or a different environment where the guest will operate
      • controls and manages the of sharing same hardware (and sometimes software) with the help of a software program called virtual machine manager(VMM)
    • Host :
      • represents the original environment where the guest is supposed to be managed
      • represented by the physical hardware ,and in some cases the operating system, that defines the environment where the VMM is running

5

9/6/2024

6 of 39

6

9/6/2024

Virtualization Layer

Virtual Hardware

Virtual Networking

Virtual Storage

Software Emulation

Host

Physical Hardware

Physical Storage

Physical Networking

Guest

Applications

Applications

Virtual Image

Virtualization Reference Model.

7 of 39

Characteristics of virtualized environments

  • Increased security - VMM controls and filters the activity of the guest by hiding or simply protecting the host from the guest.
  • Managed execution – with help of different features like
    1. Sharing : allows the creation of a separate computing environments within the same host
    2. Aggregation : by grouping(tieing EG. clusters) separate hosts and representing that group as a single virtual host to guests
    3. Emulation:
      • allowing the execution of guest programs requiring specific characteristics that are not present in the physical host Eg. For developing an Andriod app using computer needs andriod environment on host(system). so guest can consist of Andriod studio and VMM is for emulation.
    4. Isolation :
      • It allows multiple guests to run on the same host without interfering with each other.
      • It provides a separation between the host and the guest. The virtual machine can filter the activity of the guest and prevent harmful operations against the host.
  • Portability

7

9/6/2024

8 of 39

8

9/6/2024

Aggregation

Sharing

Emulation

Isolation

Virtualization

Physical Resources

Virtual Resources

9 of 39

Levels of virtualization techniques

9

9/6/2024

Operative Systems

Execution Stack

Hardware - level Virtualization

Hardware

Programming Languages

Applications

OS- level Virtualization

Programming Language level Virtualization

Application - level Virtualization

10 of 39

Taxonomy of virtualization techniques

  1. Execution virtualization - oldest, most popular, and most developed area
  2. Storage virtualization
  3. Network virtualization
  4. Desktop virtualization
  5. Application server virtualization

10

9/6/2024

Other types of virtualization techniques

11 of 39

11

Virtualization

Execution Environment

Storage

Network

….

Emulation

High-Level VM

Multiprogramming

Hardware-assisted

Virtualization

Process Level

System Level

Paravirtualization

Full Virtualization

How it is done?

Technique

Virtualization Model

Application

Programming Language

Operating System

Hardware

Partial Virtualization

12 of 39

Execution virtualization

Aims to emulate an execution environment that is separate from the one hosting the virtualization layer.

  • 2 Types depending on type of host they require
    • Process-level techniques are implemented on top of an existing operating system, which has full control of the hardware
    • System-level techniques are implemented directly on hardware and do not require or require a minimum support from existing OS
  • It can be implemented directly on top of the hardware by the OS, an application, or libraries dynamically or statically linked to an application image
  • Types depending on type of host they require
    • Hardware-level virtualization
    • Operating system-level virtualization

12

9/6/2024

13 of 39

Machine reference model

Virtualizing an execution environment at different levels of the computing stack requires a reference model that defines the interfaces between the levels of abstractions, which hide implementation details

Based on layer approach

      • Instruction Set Architecture (ISA )
        • It defines the instruction set for the processor, registers, memory, and interrupt management.
        • ISA is the interface between hardware and software
      • Application Binary Interface(ABI)
        • separates the OS layer from the applications and libraries, which are managed by the OS.
        • ABI covers details such as low-level datatypes, alignment, call, etc
        • This interface allows portability of applications and libraries
      • Application Programming Interface(API),
        • Highest level of abstraction which interfaces applications to libraries and/or the underlying operating system
    • privileged and non privileged instructions - for security

13

9/6/2024

14 of 39

Machine reference model

14

9/6/2024

15 of 39

Security rings and privilege modes

15

9/6/2024

16 of 39

Hardware-level virtualization

  • It is a virtualization technique that provides an abstract execution environment in terms of computer hardware on top of which a guest operating system can be run.
  • It is also called system virtualization, since it provides ISA to virtual machines, which is the representation of the hardware interface of a system
  • In this model,
    • Guest : is represented by the OS,
    • host : is the physical computer hardware
    • virtual machine manager : is represented by the hypervisor
  • The hypervisor is generally a program or a combination of software and hardware that allows the abstraction of the underlying physical hardware

16

9/6/2024

17 of 39

Hypervisors

2 types

  • Type I/native virtual machine hypervisors run directly on top of the hardware. It directly Interacts with the ISA interface.
  • Type II/ hosted virtual machine hypervisors require the support of an OS to provide virtualization services. Programs interacts with it through the ABI and emulate the ISA of virtual hardware for guest OS.

17

9/6/2024

18 of 39

Hardware virtualization techniques

  1. Hardware-assisted virtualization refers to a scenario in which the hardware provides architectural support for building a VMM able to run a guest operating system in complete isolation eg. VM ware in 1999
  2. Full virtualization refers to the ability to run a program(like an OS), directly on top of a virtual machine and without any modification, as though it were to run on the raw hardware.
    • Hypervisor allow to run multiple OS simultaneously on host computer and each Guest operating systems will work in complete isolation. Few implementations: Oracle's Virtualbox , VMware server, Microsoft Virtual PC

18

9/6/2024

Limitations:

1.full virtualization is usually bit slower, because of all emulation.

2.hypervisor contain the device driver and it might be difficult for new device drivers to be installed by users.

19 of 39

Hardware virtualization techniques

19

9/6/2024

3. Para virtualization:

1.unlike full virtualization, guest servers are aware of one another.

2. Hypervisor does not need large amounts of processing power to manage guest os.

3 .The entire system work as a cohesive unit.

Advantages:

  • As a guest os can directly communicate with hypervisor ,This is efficient virtualization.
  • Allow users to make use of new or modified device drivers.

Limitations:

  • Para virtualization requires the guest Os to be modified in order to interact with para virtualization interfaces.
  • It requires significant support and maintainability issues in production environment.

20 of 39

Partial virtualization

  • Partial virtualization allows many applications to run transparently, but not all the features of the operating system can be supported, as happens with full virtualization
  • Address space virtualization is a common feature of contemporary operating systems. Operating system- eg : IBM M44/44X

20

9/6/2024

21 of 39

Operating system-level virtualization

21

9/6/2024

  • EG. FreeBSD Jails, IBM Logical Partition (LPAR), SolarisZones and Containers, Parallels Virtuozzo Containers, OpenVZ

Operating system-level virtualization offers the opportunity to create different and separated execution environments for applications that are managed concurrently

22 of 39

Programming Language level Virtualization

  • mostly used to achieve ease of deployment of application.
  • It consists of a virtual machine executing the byte code of a program, which is the result of the compilation process
  • produces binary format representing the machine code for an abstract architecture
  • eg- JVM

22

9/6/2024

23 of 39

23

9/6/2024

24 of 39

Storage virtualization

24

9/6/2024

Host

VMM

Virtual Machine

binary translation

instruction mapping

interpretation

……

Guest

In memory

representation

Storage

Virtual Image

Host emulation

25 of 39

25

9/6/2024

ABI

Hardware

Operative System

ISA

Virtual Machine Manager

ISA

VM

VM

VM

VM

Hardware

ISA

Virtual Machine Manager

ISA

VM

VM

VM

VM

26 of 39

26

9/6/2024

Virtual Machine Manager

ISA

Virtual Machine Instance

Instructions (ISA)

Interpreter

Routines

Interpreter

Routines

Allocator

Dispatcher

27 of 39

27

9/6/2024

User Instructions

Sensitive Instructions

Privileged Instructions

28 of 39

28

9/6/2024

Server A

(running)

VM

VM

VM

VM

Server B

(running)

Virtual Machine Manager

VM

VM

Server A

(running)

VM

VM

VM

VM

Server B

(inactive)

Virtual Machine Manager

VM

VM

Before Migration

After Migration

29 of 39

Advantages of virtualization

  • Allows to build a secure and controllable computing environments
  • Portability
  • self-contained
  • Portability and self-containment also contribute to reducing the costs of maintenance
  • efficient use of resources -by allowing adjustment in the number of active physical resources dynamically according to the current load of the system,
  • Less energy consumption

29

9/6/2024

30 of 39

Xen: paravirtualization

  • allows high-performance execution of guest operating systems by modifying portions of the guest operating systems run by Xen with reference to the execution of instructions that require special management.
  • In this system is managed by the Xen hypervisor, which runs in the highest privileged mode and controls the access of guest operating system to the underlying hardware ie . Executes in Domain 0.
  • Guest OS are executed within Domains U(less or non privileged modes), which represent virtual machine instances
  • With the use of hypercalls, the Xen hypervisor is able to catch the execution of all the sensitive(hardware level) instructions, manage them, and return the control to the guest operating system by means of a supplied handler
  • Windows based OS does not support the XEN

30

9/6/2024

31 of 39

31

9/6/2024

Xen Hypervisor (VMM)

  • Memory management
  • CPU state registers
  • Devices I/O

User Domains (Domain U)

  • Guest OS
  • Modified codebase
  • Hypercalls into Xen VMM

User Applications

(unmodified ABI)

Management Domain (Domain 0)

  • VM Management
  • HTTP interface
  • Access to the Xen Hypervisor

Ring 3

Ring 2

Ring 1

Ring 0

Hardware (x86)

Privileged instructions

Hardware trap

32 of 39

VMware: full virtualization

  • underlying hardware is replicated and made available to the guest OS, which runs unaware of such abstraction layers and OS does not need to be modified - full virtualization
  • Implemented in one of the 2 modes
    1. Desktop environment – uses Type II hypervisors
    2. Server environment – uses Type I hypervisors
  • Full virtualization is made possible by means of
    • direct execution (for nonsensitive instructions)and
    • binary translation (for sensitive instructions) before 2006
  • The major advantage is that guests can run unmodified in a virtualized environment, when OS source code is not available. Example OS of Windows family
  • Disadvantage - translating instructions at runtime introduces an additional overhead in binary translation

32

9/6/2024

33 of 39

33

9/6/2024

Hypervisor

  • Binary translation
  • Instruction caching

Guest Operating System

  • Unmodified codebase
  • VMM unaware

User Applications

(unmodified ABI)

Ring 3

Ring 2

Ring 1

Ring 0

Hardware (x86)

Hardware trap (sensitive instructions)

Dynamic / cached translation

(sensitive instructions)

34 of 39

Microsoft Hyper-V

  • Hyper-V is an infrastructure virtualization solution
  • it uses a hypervisor-based approach to hardware virtualization
  • Hyper-V supports multiple and concurrent execution of guest OS by means of partitions.
  • A partition is a completely isolated environment in which an OS is installed and run
  • Hyper-V takes control of the hardware, and the host OS becomes a virtual machine instance with special privileges, called the parent partition/ root partition
  • Host OS provides virtualization stack for Guest OS by creating child partitions

34

9/6/2024

35 of 39

Latest Pictures.

35

9/6/2024

Hardware (x86)

Hypervisor

(Ring -1)

Hypercalls

MSRs

APIC

Scheduler

Address Management

Partition

Management

Root / Parent Partition

VMWPs

VMMS

WMI

Hypervisor-aware Kernel (Ring 0)

VSPs

VID

WinHv

I/O Stack

Drivers

VMBus

Enlightened Child Partition

User Applications

(Ring 3)

Hypervisor-aware

Wndows Kernel (Ring 0)

VSCs / ICs

WinHv

I/O Stack

Drivers

VMBus

Enlightened Child Partition

User Applications

(Ring 3)

Hypervisor-aware

Linux Kernel (Ring 0)

VSCs / ICs

LinuxHv

I/O Stack

Drivers

VMBus

Unenlightened Child Partition

User Applications

(Ring 3)

Hypervisor-unaware

Kernel (Ring 0)

Processor

Memory

36 of 39

36

9/6/2024

Hardware (x86)

Host Operating System

VMware Hypervisor (VMM)

  • Direct access to hardware
  • I/O, memory, networking for guests
  • Save/Restore CPU state for host OS

VMware Driver

Virtual Machine Instance

User Applications

VMware Workstation

Guest Operating System

User Applications

I/O

37 of 39

37

9/6/2024

Hardware (x86)

Host Operating System

VMware Hypervisor (VMM)

  • Direct access to hardware
  • I/O, memory, networking for guests
  • Save/Restore CPU state for host OS

VMware Driver

VM Instance

serverd

(daemon)

VMware

VMware

VMware

Web Server

VM Instance

VM Instance

38 of 39

38

9/6/2024

Hardware

VMkernel

hostd

VMX

CIM broker

VM

User world API

Resource

scheduling

Device drivers

Storage stack

Network stack

Distributed VM file system

Virtual Ethernet adapter and switch

VM

VM

VMM

VMM

VMM

VMX

VMX

DCUI

syslog

vxpa

SNMP

Third-party CIM plug-ins

39 of 39

39

9/6/2024

Server

ESXi

ESX

vSphere

Server

ESXi

ESX

vSphere

Data Center

vCenter

Server

ESXi

ESX

vSphere

Server

ESXi

ESX

vSphere

Data Center

vCenter

vCloud

Cloud

Infrastructure

Virtualization

vFabric

Platform

Virtualization

Zimbra

Application

Virtualization