1 of 79

Sri Raghavendra Educational Institutions Society (R)

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

www.skit.org.in

Module-2: Virtual Machines and Virtualization of Clusters and Data Centers

2 of 79

2

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Module-2: Virtual Machines and Virtualization of Clusters and Data Centers

  • Implementation Levels of Virtualization
  • Virtualization Structure/Tools and Mechanisms
  • Virtualization of CPU/Memory and I/O Devices
  • Virtual Clusters and Resource Management
  • Virtualization for Data Center Automation

3 of 79

3

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Implementation Levels of Virtualization

  • What is Virtualization?

Virtualization allows multiple virtual machines (VMs) to run on the same physical computer, sharing its hardware and resources.

  • Why Use VMs?

help improve resource utilization, allowing flexibility in running applications.

  • Types of Virtualization –
    • hardware (CPU, memory, storage) and software (operating systems, applications)
  • How It Works – Virtualization separates software from hardware, so different operating systems and applications can run on the same machine without interfering with each other.
  • Practical Benefits – Users can run multiple OS on one computer, access more memory (like virtual memory) & efficiently manage networks, storage & computing power.

4 of 79

4

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Levels of Virtualization Implementation

  • Traditional Computers – a computer has one operating system that controls its hardware.
  • What Changes with Virtualization? – Virtualization allows multiple operating systems to run on the same computer at the same time.
  • Hypervisor (VMM) – A special software manages these multiple OS and ensures they share the computer’s hardware properly, by creating virtual copies of the computer’s CPU, memory, and storage so that each OS thinks it has its own separate machine.
  • Different levels to Virtualize

Hardware level – Making the CPU and memory appear separate for each OS.

Operating system level – Allowing multiple OS to run on the same computer.

Application level – Running apps in isolated environments.

5 of 79

5

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

6 of 79

6

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

7 of 79

7

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. Instruction set architecture level
  2. What it does – ISA virtualization helps run programs made for one type of processor on another.
    • Example – A program written for MIPS can run on an x86 computer using emulation.
  3. How it works – A software translates instructions from one processor type to another.
  4. Two methods –

Code interpretation (slow) – Translates one instruction at a time.

Dynamic binary translation (faster) – Converts multiple instructions at once.

  • Why it's useful – It helps old programs run on new computers by adding a special software layer.

  1. Hardware Abstraction Level
  2. What it does – Hardware-level virtualization creates virtual hardware so multiple operating systems (OS) can share the same computer.
  3. How it works – It virtualizes CPU, memory, and devices, allowing different users to use the hardware efficiently at the same time.
  4. Examples – IBM first used this in the 1960s (VM/370), and today, Xen hypervisor helps run multiple OS (like Linux) on x86 computers.

8 of 79

8

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. Operating System Level
  2. What it does – OS-level virtualization creates containers that act like separate servers on a single computer.
  3. How it helps – It allows multiple users to share hardware securely and efficiently, making better use of resources in data centers.
  4. Where it’s used – It is mainly used for web hosting (running multiple websites on one server) and server consolidation (combining multiple services into one machine).

  1. Library Support Level
  2. What it does – Instead of using complex system calls, applications use APIs (software interfaces), which can also be virtualized.
  3. How it works – Virtualization happens by controlling API communication between applications and the system using special software.
  4. Examples – WINE lets Windows apps run on UNIX, and vCUDA allows VMs to use GPU power for faster processing.

9 of 79

9

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. User Application Level
  2. What it does – Application-level virtualization runs an application as a virtual machine (VM) instead of a normal process on an OS.
  3. How it works – A virtualization layer sits on top of the OS, allowing programs written in specific languages (like Java or .NET) to run in a controlled environment.
  4. Examples – Java Virtual Machine (JVM) and Microsoft .NET CLR allow programs to run on different systems without changes.
  5. Other forms – Application isolation/sandboxing wraps apps in a secure layer, making them easier to install and remove. Example: LANDesk runs apps without modifying the system.

10 of 79

10

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

VMM Design Requirements and Providers

  • What is a VMM? – A Virtual Machine Monitor is a software layer that sits between the hardware and operating systems, managing system resources.
  • VMM requirements:
    • It should act like the original machine
    • Programs should run with little performance loss.
    • It must have full control over system resources.
  • Performance challenges: – Running multiple VMs on one machine can cause small delays due to sharing resources. If VMMs are too slow, they are not useful.
  • Efficiency improvement: – To work faster, most instructions run directly on the processor, with only a few needing VMM intervention.
  • Hardware-assisted virtualization: – Some processors, like x86, need extra hardware modifications to support virtualization properly.

11 of 79

11

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

12 of 79

12

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization Support at the OS Level

  • Why OS-Level Virtualization?
    • Cloud computing allows companies to rent computing power instead of buying and managing their own hardware.Some processors (like x86) have trouble handling certain instructions in VMs. To fix this, special hardware changes are made—this is called hardware-assisted virtualization(full VM).
    • Main challenge
  • Workloads change: – Cloud systems need to adjust resources based on demand.
    • Main challenge 2: – Starting new VMs is slow because they either boot from scratch or copy a pre-made VM, but they don’t remember the application’s current state.
  • OS-Level Virtualization (Containers) – Instead of making a full VM, it creates lightweight VMs (called containers).
  • These:
    • Use the same operating system (OS) instead of creating a new one.
    • Are faster to start and take up less space.
    • Still look like separate machines to users, but they share the same OS.

13 of 79

13

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Advantages of OS Extensions

  1. Faster & Lighter – containers start and stop quickly, use fewer resources, and can handle more workloads i.e it Solves slow startup .
  2. Better Syncing – can update their state with the host system when needed by Keeping track of the app state

How Does OS-Level Virtualization Work?

    • Shared OS Kernel – All containers on the same machine use the same OS
    • Controlled Access – Containers can use the host’s resources without modifications

Disadvantages of OS Extensions

Same OS Family Required – All containers on one machine must use the same type of OS.

How VMs Access Resources

  • Each container gets a "virtual root directory" (its own mini filesystem). Two ways to set this up:
    • Duplicate everything for each container (wastes space).
    • Share most resources and only make private copies when needed (more efficient).

Why OS-Level Virtualization is a Second Choice

    • Because of its same OS limitation and potential resource costs.

14 of 79

14

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

15 of 79

15

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 1: Virtualization support for Linux platform

  • OpenVZ is a open-source tool that helps run multiple virtual machines (VPSes) on a single Linux system by making small changes to the Linux system to work.
  • Each VPS acts like a normal Linux server with its own files, users, processes, and network settings.
  • All VPSes share the same Linux system but remain separate from each other.
  • Disk space is managed at two levels: the OpenVZ admin sets a total limit, and the VM admin distributes space among users.
  • CPU time is also managed at two levels: OpenVZ decides how much CPU each VM gets, and Linux handles tasks inside the VM.
  • OpenVZ has 20+ settings to control what each VM can use.
  • It supports saving a VM’s state (checkpointing) so it can be moved to another machine and restarted quickly.
  • Moving a VM (live migration) takes only a few seconds, but network connections may have a slight delay.

16 of 79

16

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Middleware Support for Virtualization

  • Library-level virtualization helps run programs made for one system on another without needing a full virtual machine.
  • It works by changing (remapping) system calls so the program can understand the new system.
  • Examples:

WABI – Helps Windows programs run on Solaris.

Lxrun – Helps Linux programs run on UNIX.

WINE – Lets Windows apps run on Linux or UNIX.

Visual MainWin – Helps Windows programs (made with Visual Studio) run on UNIX.

  • This method only adjusts the needed parts, making it faster than running a full OS in a VM.

17 of 79

17

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

18 of 79

18

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 2: The vCUDA for Virtualization of General-Purpose GPUs

  • CUDA is a tool that helps programs use GPUs for faster processing.
  • Running CUDA programs on virtual machines (VMs) is difficult because they don’t have direct access to the GPU.
  • vCUDA is a solution that allows CUDA programs to run inside a VM by redirecting their GPU requests to the real GPU on the host machine.

  • How vCUDA works?
  • vCUDA Library (Guest OS): Acts as a fake CUDA library inside the VM. It captures program requests for the GPU.
  • vGPU (Guest OS): Creates a virtual GPU so programs think they have their own GPU. It helps with memory management.
  • vCUDA Stub (Host OS): Receives the GPU requests, processes them on the real GPU, and sends the results back to the VM.

19 of 79

19

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

20 of 79

20

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization Structures/Tools and Mechanisms

21 of 79

21

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Hypervisor and Xen Architecture

  • Hypervisor provides "hypercalls", which are special instructions that let VMs talk to the hardware.
  • Types of Hypervisors:

1.Micro-kernel Hypervisor (e.g., Microsoft Hyper-V)

    • Small and lightweight: Only includes essential functions like memory management and CPU scheduling.
    • Other functions (like device drivers) run outside the hypervisor for flexibility

2. Monolithic Hypervisor (e.g., VMware ESX)

    • Bigger and includes everything, including device drivers.
    • Handles all functions inside the hypervisor itself.

22 of 79

22

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

The Xen Architecture

  • Xen is an open-source micro-kernel hypervisor, meaning it only handles basic tasks and leaves other work to a special VM called Domain 0.
  • Domain 0 is the main controller and manages the other VMs (Domain U).
  • Xen is small and efficient as it does not include device drivers—instead, guest OSes access hardware directly.

How Xen Works:

  • Domain 0 (Privileged VM) - First VM to start when Xen boots, Has full access to hardware and manages other VMs.
  • Domain U (Guest VMs) - Regular VMs that depend on Domain 0 to access resources.

Security Issues:

Concern : If Domain 0 is hacked, the attacker can control all VMs.

23 of 79

23

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

i) Binary Translation with Full Virtualization

  • Full virtualization runs the guest OS without modifying the host OS, using binary translation to handle certain instructions.
  • Host-based virtualization requires both a host OS and a guest OS, with a software layer managing communication between them.

Full Virtualization

  • noncritical instructions run directly on the hardware, while critical instructions are handled by VMM.
  • Only critical instructions are trapped because translating all instructions would slow down performance.
  • Noncritical instructions are safe and do not control hardware.

ii) Binary Translation of Guest OS Requests using a VMM

  • VMM at Ring 0 and the guest OS at Ring 1.
  • The VMM scans and traps important instructions, using binary translation to handle them while allowing other instructions to run directly on hardware.
  • This method makes the guest OS unaware that it is virtualized but can slow down performance, especially for I/O-heavy applications.

24 of 79

24

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

iii) Host-Based Virtualization

  • virtualization layer is installed on top of the host OS, which still manages the hardware.
  • Guest OSes run on the virtualization layer, while some applications can run directly on the host OS.
  • It is easy to install since it does not require modifying the host OS and can use its drivers and services.
  • This method works with different hardware setups but has lower performance because requests must go through multiple layers.
  • If the guest OS and hardware have different instruction sets, binary translation is needed, making it even slower.

25 of 79

25

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Para-Virtualization with Compiler Support

  • Para-virtualization improves performance by modifying the guest OS to work better with virtualization.
  • Instead of fully simulating hardware, it provides special APIs that require changes in the OS but reduce virtualization overhead.
  • A compiler helps replace nonvirtualizable instructions with hypercalls, which allow the guest OS to communicate efficiently with the virtualization layer.
  • In x86 processors, instructions run in different privilege levels called rings:
    • Ring 0: Used by the OS to manage hardware and run critical instructions.
    • Ring 3: Used by applications that do not need direct hardware access
  • This approach improves performance compared to full virtualization but requires modifying the OS.
  • Some issues with para-virtualization include:

Compatibility concerns – It may not work with unmodified operating systems.

High maintenance cost – Modifying and maintaining the OS kernel requires effort.

Performance variation – The benefits depend on the workload.

26 of 79

26

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. Para-Virtualization Architecture

27 of 79

27

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

ii) Kernel Based VM(KVM):

  • KVM is a part of the Linux 2.6.20 kernel used for virtualization.
  • It uses the existing Linux kernel to manage memory and scheduling tasks.
  • KVM handles virtualization tasks, making it simpler than a hypervisor that controls the whole system.
  • KVM uses hardware support to improve performance.
  • It can run unmodified operating systems like Windows, Linux, Solaris, and other UNIX versions.

iii) Para-Virtualization with Compiler Support

  • Para-virtualization reduces overhead but needs changes in the OS, making maintenance costly.
  • KVM uses the Linux kernel for memory management and supports OS like Windows, Linux, and UNIX.
  • In para-virtualization, sensitive instructions are replaced with hypercalls to improve performance.
  • Xen uses Ring 1 instead of Ring 0 to control the guest OS securely.
  • Many tools like KVM, Xen, and VMware ESX use para-virtualization for better performance.

28 of 79

28

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 3: VMware ESX Server for Para-Virtualization

29 of 79

29

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • VMware is a company that creates software for virtualization on desktops, servers, and data centers
  • ESX is a hypervisor (VMM) used in large servers to manage hardware resources like CPU, memory, and disk.
  • It works directly with hardware without using the host operating system, improving performance.
  • An ESX server has four main parts:
    • virtualization layer,
    • resource manager,
    • hardware interface, and
    • service console.
  • The virtualization layer creates virtual hardware like CPU, memory, and disk for each VM.
  • The resource manager controls how much CPU, memory, and disk each VM gets.
  • The hardware interface includes device drivers and file systems.
  • The service console helps to boot the system and manage the VMM.

30 of 79

30

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization of CPU, Memory and I/O Devices

31 of 79

31

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. Hardware Support for Virtualization
  2. Modern processors allow multiple processes to run at the same time.To avoid system crashes, processors have two modes:
    • user mode (for normal tasks) and
    • supervisor mode (for critical tasks).
  3. In virtualization, it becomes harder to manage systems because there are more layers involved.
  4. VMware Workstation is software that creates multiple virtual machines (VMs) on x86 and x86-64 computers.
  5. Xen is a hypervisor modifies Linux to act as the main control system (most privileged).
  6. KVM is a Linux-based tool that supports both hardware-assisted virtualization and para-virtualization.

32 of 79

33 of 79

34 of 79

35 of 79

36 of 79

36

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 4: Hardware Support for Virtualization in Intel x86 Processor

  • For processor virtualization, Intel uses VT-x (or VT-i), which adds a special mode called VMX Root Mode to control sensitive instructions.
  • This means the VMM (Virtual Machine Monitor) can automatically catch and control any critical instructions.
  • For memory virtualization, Intel uses EPT (Extended Page Table), which quickly converts virtual memory to physical memory, improving performance.
  • For I/O virtualization (like connecting devices), Intel uses VT-d and VT-c to manage input/output devices efficiently.

37 of 79

37

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Hardware Assisted CPU Virtualization

  • Intel and AMD made virtualization easier by adding a new mode called Ring -1 in x86 processors.
  • The hypervisor runs in Ring -1, and the operating system (OS) still runs in Ring 0.
  • Any critical or sensitive instructions from the OS are automatically controlled by the hypervisor.
  • This removes the need for complex binary translation and allows the OS to run without any changes.

38 of 79

38

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Eg 5: Intel Hardware Assisted CPU Virtualization

  • critical instructions need special handling to avoid errors.
  • Critical instructions are of three types:
    • Privileged,
    • Control-sensitive, and
    • Behavior-sensitive.
  • RISC CPUs easily support virtualization, but x86 CPUs face issues as some critical instructions cannot be controlled easily.
  • Intel and AMD introduced Ring -1 mode for the hypervisor, allowing the OS to run in Ring 0 without changes.
  • This method improves performance, but sometimes software methods like binary translation are still needed.

39 of 79

39

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Normally OS use page tables, which map virtual memory to actual machine memory, with the help of MMU &TLB.
  • In a virtualized system, memory has to be shared among multiple VMs, requiring two levels of mapping.
    1. guest OS maps virtual memory to its own "physical memory" (which is actually virtual too).
    2. VMM maps this "physical memory" to the actual machine memory.
  • Since the guest OS cannot directly access real memory, the VMM handles the translation.

Memory Virtualization

  • To keep track of these mappings, the VMM uses "shadow page tables," which are extra copies of page tables, which increases memory overhead and reduces performance.
  • Some processors use a technique called "nested paging" to handle this more efficiently with hardware support.

40 of 79

40

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Extended Page Table by Intel for Memory Virtualization

41 of 79

41

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • shadow page table method was slow, so Intel created a better hardware-based method called Extended Page Tables (EPT).
  • EPT helps speed up memory virtualization by reducing the extra work needed for memory translation.
  • Intel introduced Virtual Processor ID (VPID) to improve the efficiency of the TLB
  • Both the guest OS and EPT use four levels of page tables for memory translation.
  • When a virtual address is to be translated, the CPU first checks the top-level (L4) page table of guest OS.
  • Since the guest OS only knows its own virtual memory, the CPU must convert it into the actual physical address using EPT.
  • The CPU first looks in a special memory cache (EPT TLB) to see if the translation is already available.
  • If the translation isn’t found, the CPU searches in the EPT page tables.
  • If the CPU still can’t find the correct mapping, an error (EPT violation) occurs, and the system takes action to fix it.
  • The CPU repeats this process for lower-level page tables (L3, L2, L1) until it finds the correct mapping.
  • If there’s an issue in any step, the guest OS gets an interrupt and tries to fix the problem.
  • This method makes virtual memory translation much faster and more efficient compared to the older shadow page table approach.

42 of 79

42

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • It allows multiple VMs to share the same physical hardware for input and output tasks.
  • Three main methods of I/O virtualization:
  • Full device emulation: The VMM creates a software version of real hardware.
  • Para-virtualization: Uses two drivers—one in the VM (frontend) and one in the VMM (backend)
  • Direct I/O: The VM accesses the hardware directly.
  • Challenges in Direct I/O: When a device is reassigned between VMs, it might cause errors or system crashes.

I/O Virtualization

  • Hardware-assisted virtualization (Intel VT-d): Helps by efficiently managing memory transfers and device access.
  • Self-Virtualized I/O (SV-IO): Uses multiple processor cores to improve virtual device performance by creating virtual interfaces for different I/O devices like network cards and storage.

43 of 79

43

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization in Multi-core Processors

  • In Multi-core virtualization,multiple cores are shared & hence needs effecient management.
  • Two main challenges:
  • Applications must be written to use all cores effectively (parallel programming).
  • The system must decide how to assign tasks to different cores.
  • Solutions:
  • New programming models, languages, and libraries help with parallel programming.
  • Research on scheduling algorithms and resource management aims to improve task distribution.
  • New problem:
    • As technology advances, processors now combine different types of cores (powerful CPU cores and energy-efficient GPU cores).
    • Managing these mixed cores (dynamic heterogeneity) is even harder due to increased complexity and hardware reliability issues.

44 of 79

44

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Virtual Hierarchy

45 of 79

45

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Many-core processors allow multiple tasks to run simultaneously on different core groups, a concept called space-sharing (unlike traditional time-sharing).
  • Marty and Hill’s proposal: Introduced virtual hierarchies to manage caching and memory more efficiently, adapting dynamically to workloads rather than relying on a fixed cache structure.
  • The first level of the virtual hierarchy places frequently used data closer to the cores that need it, reducing delays and interference.
  • The second level maintains a globally shared memory, allowing resource redistribution without costly cache flushing.
  • Example setup:

Database workloads run on one cluster of virtual cores.

Web server workloads run on another cluster.

Middleware workloads run on a third cluster.

Each workload operates in isolation to prevent conflicts and improve performance.

  • Key benefits:

Faster data access with reduced delays.

Efficient resource allocation and minimal interference.

Supports virtualization techniques like content-based page sharing.

Improves server consolidation and multiprogramming performance.

46 of 79

46

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtual Clusters and Resource Management

47 of 79

47

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Physical versus Virtual Clusters

48 of 79

48

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Virtual clusters are created by using VMs on different physical servers, which may belong to one or multiple physical clusters.
  • A virtual cluster consists of both physical machines and virtual machines. and they can have different operating systems.
  • Each VM runs with its own guest operating system, which is separate from the host operating system of the physical machine. This allows different environments to exist on the same server.
  • VMs help in better server utilization by allowing multiple applications or functions to run on the same physical machine instead of using multiple separate machines.
  • VMs can be duplicated across multiple servers to support distributed computing, fault tolerance (in case of failures), and disaster recovery (ensuring data is not lost if a failure happens).
  • The size of a virtual cluster is not fixed. It can expand or shrink dynamically by adding or removing VMs, just like peer-to-peer (P2P) networks adjust based on the number of active users.
  • If a physical machine fails, the VMs running on it may stop working, but this does not affect the entire system. Other VMs and physical machines will continue to function.

49 of 79

49

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Since many VMs run across different physical servers, managing them properly is important. This includes tasks like scheduling resources, balancing loads, consolidating servers, and ensuring fault tolerance.
  • A single physical cluster can support multiple virtual clusters, each customized for specific applications. Different colors in diagrams usually indicate different virtual clusters.
  • Since a large number of VM images (virtual copies of operating systems and applications) need to be stored, efficient storage methods are needed.
  • A common approach is to use template VMs, which are pre-installed with commonly used software (like operating systems and basic applications). These templates help create new VMs quickly without reinstalling everything from scratch.
  • Users can add their own specific software, libraries, and applications to these template-based VMs to customize them for different tasks.
  • Virtual clusters are flexible and keep changing as VMs are added, removed, or migrated across different physical servers over time.

50 of 79

50

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Fast Deployment and Effective Scheduling
  • The system should quickly deploy software (OS, libraries, applications) and switch between virtual clusters to free up resources when not in use. This helps save power and allows other users to utilize the system efficiently.
  • Green computing aims to reduce energy consumption, but older methods focused only on single computers rather than entire clusters. Some energy-saving techniques work only for specific setups, limiting their effectiveness.
  • Live migration of VMs helps balance workloads by moving tasks between machines, but excessive migration can slow down performance and reduce efficiency. A smart migration strategy is needed to save energy without affecting system performance.
  • Virtualization helps distribute workloads efficiently across a cluster. By monitoring system usage and user activity, the system can automatically scale resources up or down, ensuring smooth operation and better performance.

51 of 79

51

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • High-Performance Virtual Storage
  • Template VMs help create and customize virtual machines (VMs) on different physical servers. They reduce the time needed for setting up and switching between virtual environments.
  • Efficient storage management is important to avoid wasting disk space. Some systems reduce duplicate data blocks using special storage designs, where hash values help identify and compare data.
  • Users have profiles that store information about their VM data. When they modify files, new data blocks are created and recorded in their profiles.
  • Deploying VMs involves four steps: preparing a disk image, configuring the VMs, selecting destination servers, and running the deployment process on each host.
  • Templates simplify deployment because they come with a pre-installed OS and sometimes software. Users can copy a template instead of setting up everything from scratch.
  • Copy on Write (COW) storage makes VM copies small and easy to transfer, saving both disk space and time.
  • VM configuration includes setting up a name, disk image, network, CPU, and memory. Instead of configuring each VM manually, profiles with pre-set settings can be used to speed up the process.
  • Some settings, like VM name and IP address, are generated automatically, so users don’t have to configure them manually.
  • Choosing the right server for each VM is important for balancing workloads across the entire system. The goal is to meet VM requirements while avoiding overloading any single server.

52 of 79

52

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

ii) Live VM Migration Steps and Performance Effects

53 of 79

53

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • In a cluster, both physical machines and virtual machines (VMs) work together. Normally, everything runs on physical machines, but if a VM fails, another VM can take over if they have the same operating system.
  • If a physical machine fails, the VM running on it also stops. This problem can be reduced using live migration, which moves a running VM from one machine to another without stopping it.
  • Ways to manage virtual clusters:

a) Guest-based management – The manager runs inside a VM. Example: openMosix.

b) Host-based management – The manager runs on the physical machine and can restart VMs on another host. Example: VMware HA.

c) Independent cluster manager – A separate system manages both physical and virtual resources, but it’s more complex.

d) Integrated cluster management – A system that manages both physical and virtual resources efficiently.

  • Virtual clusters are useful in cloud computing because they can when needed or if a system fails.
  • Live migration of a VM means moving it from one machine to another while it is still running. The goal is to make this process fast, use less internet bandwidth, and not disturb other services.

54 of 79

54

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

iii) Migration of Memory, Files and Network Resources

  • Clusters are expensive because they need space, power, and cooling.
  • Sharing or renting clusters is a good option when needs change over time.
  • Shared clusters save money and use resources better by allowing multiple users to share them.
  • Early systems focused on setting up clusters for specific tasks and dividing them properly.
  • When moving a system to another machine, some important factors must be considered.

  • Memory Migration
  • Moving a VM’s memory from one machine to another is very important in VM migration.
  • There are different ways to do this, but most methods follow similar ideas.
  • The method used depends on the type of work the VM is handling.
  • Memory migration size can be from hundreds of MBs to a few GBs and must be done efficiently.
  • Internet Suspend-Resume (ISR) method reduces data transfer by only moving changed files.
  • ISR saves time by using a tree structure to track file changes and send only updated data.
  • ISR is useful when live migration isn’t needed, but it has longer downtime.

55 of 79

55

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • File System Migration
  • VMs need access to files from any location when migrating.
  • One way is to give each VM a virtual disk and move it with the VM, but this is slow because disks are large.
  • A better way is to use a global file system so files are accessible from any machine, avoiding copying.
  • ISR uses a distributed file system to move suspended VM data, but it only copies necessary files instead of the whole file system.
  • Smart copying saves time by only transferring file changes, useful when moving between known locations like home and office.
  • If location changes are unpredictable, the system can recreate most of the data at the new location instead of copying everything.

56 of 79

56

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Network Migration
  • A migrating virtual machine (VM) must keep all network connections active without extra support from the original host.
  • Each VM has a virtual IP address that remains the same even after migration and a unique virtual MAC address.
  • The Virtual Machine Manager (VMM) keeps track of these addresses.
  • When a VM moves within the same local network (LAN), the system updates the network to recognize its new location.
  • Some data packets may be lost during migration, but overall communication remains smooth.
  • Another method allows the VM to keep its original MAC address, letting the network switch detect its new location automatically.

a) Live Migration

Moves a VM from one machine to another without stopping applications.

Useful for system maintenance, workload balancing, and performance improvements.

Traditional migration: Pauses the VM, moves it, then restarts it.

57 of 79

57

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • Precopy Migration

First, copies all memory pages.

Then, only transfers modified pages in later rounds.

Reduces downtime but may slow down performance.

  • Challenges in Precopy Migration:

Network bandwidth usage is high, causing performance drops.

Adaptive rate limiting reduces network load but makes migration much slower.

A limit is set on memory copies because not all applications can reduce their data size effectively.

  • Alternative Methods:

a) Checkpointing/Recovery and Trace/Replay (CR/TR-Motion):

Records system activities in small log files instead of copying full memory.

Faster migration with less downtime.

Works only if logs can be replayed faster than they are created.

58 of 79

58

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

b) Postcopy migration:

Transfers memory pages only once instead of multiple rounds.

Reduces total migration time but increases downtime, as the new machine must wait for missing data.

c) Memory compression for faster migration:

Uses extra CPU power on modern computers to compress memory pages before sending them.

Reduces data transfer size and speeds up migration.

Compression uses little memory and is very fast.

59 of 79

59

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 7: Live Migration of VMs b/w Two Xen-Enabled Hosts

60 of 79

60

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 7: Live Migration of VMs b/w Two Xen-Enabled Hosts

  • Xen allows moving a running Virtual Machine (VM) from one physical machine to another with little or no downtime.
  • The VM’s memory and state are transferred over a network while it keeps running.
  • Remote Direct Memory Access (RDMA) speeds up migration by avoiding extra CPU work, allowing data to move directly between machines without delays.
  • Memory data is compressed before being sent to make migration faster and more efficient.
  • Different compression methods are used based on the type of data.
  • A shadow page table tracks changes in the VM’s memory.
  • A list (bitmap) records which memory pages have changed.
  • During migration, the system first sends all memory pages, then updates only the changed ones.
  • The changed pages are compressed, sent to the new machine, and decompressed there.
  • This ensures smooth migration with minimal impact on the running VM.

61 of 79

61

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

iv) Dynamic Deployment of Virtual Clusters

62 of 79

62

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

iv) Dynamic Deployment of Virtual Clusters

63 of 79

63

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 8: The Cluster-on-Demand (COD) Project at Duke University

64 of 79

64

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 8: The Cluster-on-Demand (COD) Project at Duke University

  • The COD (Cluster-on-Demand) project by Duke University dynamically assigns servers from a shared pool to virtual clusters (vClusters).
  • A physical cluster is divided into multiple vClusters, where users specify operating systems and software using an XML-RPC interface.
  • The vClusters use Sun’s GridEngine scheduler to run workloads, adjusting their size based on demand.
  • COD improves resource management by enabling dynamic cluster sharing, resource reservation, and efficient use of idle resources.
  • A configuration database helps manage user requests and resource policies.
  • An eight-day test using 80 IBM servers showed significant variations in vCluster sizes, proving the need for dynamic provisioning in real-world applications.

65 of 79

65

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 9: The VIOLIN Project at Purdue University

66 of 79

66

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 9: The VIOLIN Project at Purdue University

  • The Purdue VIOLIN Project uses live VM migration to improve resource use in virtual clusters.
  • It helps run multiple cluster jobs efficiently across different physical clusters.
  • The system creates isolated virtual environments (VIOLIN 1–5) on shared physical infrastructure.
  • These virtual environments can move across servers and adjust resource usage as needed.
  • This adaptation happens automatically and does not affect users or administrators.
  • In a test solving a complex problem, adaptation took only 20 seconds out of 1,200 seconds, adding less than 1% to execution time.
  • This small delay is worth it because it improves resource sharing and benefits multiple users.
  • Virtual networking plays a key role in the VIOLIN system.

67 of 79

67

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization for Data-Center Automation

68 of 79

68

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Virtualization for Data-Center Automation

  • Data centers are growing rapidly, with major IT companies like Google, Amazon, Microsoft, and Apple investing billions in building and automating them.
  • Automation allows these data centers to dynamically manage hardware, software, and databases for millions of users while ensuring quality service and cost-effectiveness.
  • This growth is driven by virtualization and cloud computing, which help improve resource management.
  • In 2006, virtualization was a $1 billion market, mainly used for consolidating servers and software development.
  • Virtualization is evolving to improve mobility, reduce downtime, and support more virtual clients.
  • New trends focus on high availability, backup services, and workload balancing.
  • By 2011, the market for virtualization was expected to grow to $3.2 billion, with major investments in high availability, utility computing, and client expansion.
  • Future discussions will cover topics like server consolidation, virtual storage, OS support, and trust management in automated data centers.

69 of 79

69

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  1. Server Consolidation in Data Centers
  2. Data centers run different types of workloads: chatty workloads, which have high and low activity periods (like video streaming), and noninteractive workloads, which run automatically (like scientific computing).
  3. To handle peak demand, servers are often given more resources than needed, leading to wasted space, power, and costs.’
  4. Server consolidation reduces the number of physical servers by using virtualization, improving efficiency and lowering costs.
  5. Server virtualization has key benefits:

a) Better hardware utilization by combining multiple underused servers.

b) Faster resource deployment using cloned virtual machines (VMs).

c) Reduced costs in buying new servers, power, and maintenance.

d) Improved availability, as a VM crash doesn’t affect others.

  • To manage virtualized data centers efficiently, resource scheduling is crucial.
  • Scheduling happens at different levels: VM level, server level, and data-center level, but current methods only focus on one or two levels.
  • Dynamic CPU allocation adjusts resources based on workload demand, improving efficiency.
  • Multicore processors (CMP) and virtualization work together but still face challenges, like optimizing memory usage and reducing delays.
  • Power management must balance energy savings with maintaining performance, considering differences in hardware.

70 of 79

70

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

ii) Virtual Storage Management

  • Storage virtualization originally meant grouping and dividing physical disks but now involves managing virtual storage through VMMs and guest OSes. Stored data includes VM images (specific to virtual environments) and application data (same as traditional OS storage).
  • Encapsulation and isolation in virtualization allow multiple VMs to run independently on one physical machine. However, storage systems have not advanced as quickly as CPUs and software, creating performance bottlenecks.
  • Storage management becomes complex as multiple VMs compete for storage, making operations like remapping volumes or checkpointing disks difficult. With thousands of VMs in data centers, VM images take up significant storage space.
  • Researchers aim to simplify storage management, improve performance, and reduce storage usage. Parallax, a distributed storage system, customizes storage for virtualization, while Content Addressable Storage (CAS) helps reduce VM image sizes.
  • Parallax moves storage functions from high-end hardware to storage VMs, which share space with regular VMs. Each physical machine has a dedicated storage appliance VM, acting as a bridge between VMs and physical storage, providing a virtual disk for each VM.

71 of 79

71

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 10: Parallax Providing Virtual Disks to Client VMs from a Large Common Shared Physical Disk

72 of 79

72

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 10: Parallax Providing Virtual Disks to Client VMs from a Large Common Shared Physical Disk

  • Parallax is scalable and works well in cluster-based environments. A centralized management system oversees all storage appliance VMs, simplifying storage management.
  • The storage appliance VM moves storage functions from data-center hardware to individual hosts, enabling advanced storage features like snapshots through software.
  • Parallax runs as a user-level application inside the storage appliance VM and provides virtual disk images (VDIs) to VMs. VDIs are single-writer virtual disks that can be accessed from any physical host in the cluster.
  • Parallax uses Xen’s block tap driver for handling storage requests and implements it as a tapdisk library, acting as a central block virtualization service for all VMs on the same host.
  • The storage appliance VM connects directly to physical storage hardware and includes device drivers. This setup allows live upgrades of block device drivers without disrupting the system.

73 of 79

73

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

iii) Cloud OS for Virtualized Data Centers

74 of 79

74

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 11: Eucalyptus for Virtual Networking of Private Cloud

75 of 79

75

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 11: Eucalyptus for Virtual Networking of Private Cloud

  • Eucalyptus is an open-source software designed for Infrastructure as a Service (IaaS) clouds. It mainly manages virtual networking and VMs but does not support virtual storage.
  • It helps in building private clouds that can connect to users via Ethernet or the Internet and can also interact with other private or public clouds. However, it lacks strong security and some features needed for general cloud applications.
  • Eucalyptus is built as a set of web services, each with its own API for communication. It uses WS-Security policies to enable secure connections between components.’
  • The system has three main resource managers:

a) Instance Manager – Manages VM execution, monitoring, and termination.

b) Group Manager – Schedules VM execution and manages networking.

c) Cloud Manager – Acts as the main entry point, gathers resource info, and makes scheduling decisions.

  • Eucalyptus functions like AWS EC2 and can interact with it. It also provides a storage API similar to Amazon S3 for storing data and VM images.
  • It runs on Linux-based platforms and supports SOAP, REST, CLI, and web portal services for management.

76 of 79

76

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 12: VMware vSphere 4 as a Commercial Cloud OS

77 of 79

77

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Example 12: VMware vSphere 4 as a Commercial Cloud OS

78 of 79

78

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • I/O virtualization allows multiple VMs to share the same physical hardware for input and output tasks.
  • Three main methods of I/O virtualization:

Full device emulation: The VMM creates a software version of real hardware. It is slow because everything is done in software.

Para-virtualization: Uses two drivers—one in the VM (frontend) and one in the VMM (backend)—to communicate more efficiently. This improves speed but increases CPU usage.

Direct I/O: The VM accesses the hardware directly, giving near-native performance but making resource management difficult.

  • Challenges in Direct I/O: When a device is reassigned between VMs, it might cause errors or system crashes.
  • Hardware-assisted virtualization (Intel VT-d): Helps by efficiently managing memory transfers and device access.
  • Self-Virtualized I/O (SV-IO): Uses multiple processor cores to improve virtual device performance by creating virtual interfaces for different I/O devices like network cards and storage.

79 of 79

79

3/17/2025

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

  • In a normal system, the operating system manages memory using page tables, which map virtual memory to actual machine memory, with the help of special hardware like the MMU and TLB.
  • In a virtualized system, memory has to be shared among multiple virtual machines (VMs), requiring two levels of mapping.
  • First, the guest OS maps virtual memory to its own "physical memory" (which is actually virtual too).
  • Then, the Virtual Machine Monitor (VMM) maps this "physical memory" to the actual machine memory.
  • Since the guest OS cannot directly access real memory, the VMM handles the translation.
  • To keep track of these mappings, the VMM uses "shadow page tables," which are extra copies of page tables.
  • This additional mapping process increases memory overhead and reduces performance.
  • Some processors use a technique called "nested paging" to handle this more efficiently with hardware support.
  • VMware uses shadow page tables to manage memory mapping, while modern processors like AMD Barcelona (since 2007) have built-in support for better performance.