2-Implementation Level Of Virtualization-06-01-2025.pptx

dhruvagarwal9427 12 views 55 slides Feb 27, 2025
Slide 1
Slide 1 of 55
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55

About This Presentation

Virtualization


Slide Content

Winter Semester 2025 Cloud Computing ( BITE 412 L ) Dr.M.Sudha Associate Professor Senior Department of Information technology School of Information Technology & Engineering, VIT Vellore Module 2 Virtualization

Virtualization Virtualization in cloud computing is a technology that allows you to create virtual versions of physical resources, such as servers, storage devices, and networks. This means you can run multiple virtual machines on a single physical machine, making efficient use of hardware resources 1/28/2025 2

Implementation Levels of Virtualization Virtualization technology benefits the computer and IT industries by enabling users to share expensive hardware resources by multiplexing VMs on the same set of hardware hosts. 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. O/S, provided services). 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, etc. Provide infrastructure API: Plug-ins to hardware/support structures 1/28/2025 3 Hardware OS App App App Hypervisor OS OS Virtualized Stack

Virtual Machines VM technology allows multiple virtual machines to run on a single physical machine. 1/28/2025 4 Hardware Virtual Machine Monitor (VMM) / Hypervisor Guest OS (Linux) Guest OS (NetBSD) Guest OS (Windows) VM VM VM App App App App App Xen VMWare UML Denali etc. Performance : Para-virtualization (e.g. Xen) is very close to raw physical performance!

Virtualization in General 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). Run legacy systems! 1/28/2025 5

What is the purpose and benefits? Cloud computing enables companies and applications, which are system infrastructure dependent, to be infrastructure-less. By using the Cloud infrastructure on “pay as used and on demand”, all of us can save in capital and operational investment! Clients can: Put their data on the platform instead of on their own desktop PCs and/or on their own servers. They can put their applications on the cloud and use the servers within the cloud to do processing and data manipulations etc. In computing, virtualization means to create a virtual version of a device or resource, such as a server, storage device, network or even an operating system where the framework divides the resource into one or more execution environments. 1/28/2025 6

Difference between Traditional and Virtual machines A traditional computer runs with a host operating system specially tailored for its hardware architecture After virtualization, different user applications managed by their own operating systems (guest OS) can run on the same hardware, independent of the host OS. The Virtualization layer is the middleware between the underlying hardware and virtual machines represented in the system, also known as virtual machine monitor (VMM) or hypervisor . 1/28/2025 7 With sufficient storage, any computer platform can be installed in another host computer, even if they use processors with different instruction sets and run with distinct operating systems on the same hardware.

Virtualization Layers The virtualization software creates the abstraction of VMs by interposing a virtualization layer at various levels of a computer system. Common virtualization layers include : Instruction set architecture (ISA) level, Hardware level, Operating system level, Library support level, Application level 1/28/2025 8

Virtualization Ranging from Hardware to Applications in Five Abstraction Levels 1/28/2025 9

1.Virtualization at Instruction Set Architecture (ISA) level: At the ISA level, virtualization is performed by emulating a given ISA by the ISA of the host machine. Instruction set emulation leads to virtual ISAs created on any hardware machine. An interpreter is used to convert the guest system's binary code into a format that the host system can understand and execute e.g, MIPS binary code can run on an x-86-based host machine with the help of ISA emulation. With this approach, it is possible to run a large amount of legacy binary code written for various processors on any given new hardware host machine. code interpretation – dynamic binary translation - virtual instruction set architecture (V-ISA) best application flexibility. 1/28/2025 10

Advantage: It can run a large amount of legacy binary codes written for various processors on any given new hardware host machines Shortcoming & limitation: One source instruction may require tens or hundreds of native target instructions to perform its function, which is relatively slow. V-ISA requires adding a processor-specific software translation layer in the complier 1/28/2025 11

2.Virtualization at Hardware Abstraction level: Hardware-level virtualization is performed right on top of the bare hardware. On the one hand, this approach generates a virtual hardware environment for a VM. On the other hand, the process manages the underlying hardware through virtualization. The idea is to virtualize a computer’s resources, such as its processors, memory and I/O devices. The intention is to upgrade the hardware utilization rate by multiple users concurrently. Advantage: Has higher performance and good application isolation Shortcoming & limitation: Very expensive to implement (complexity) 1/28/2025 12

how to describeVirtualization at HAL level Virtualization at the Hardware Abstraction Layer (HAL) level involves abstracting the hardware details from the operating system, allowing the same operating system to run on different hardware configurations without modification. Here’s a brief overview: Abstraction : The HAL provides a layer of abstraction between the hardware and the software, translating hardware-specific operations to generalized operations that the OS can handle. Portability : This makes the OS more portable as it can run on various hardware platforms without requiring changes to the OS itself. 1/28/2025 13

Compatibility : The HAL ensures compatibility by providing a consistent interface for the OS to interact with different hardware components like processors, memory, and input/output devices. Performance : While it introduces a level of abstraction, a well-designed HAL can minimize performance overhead, maintaining efficiency. This type of virtualization is beneficial in scenarios where multiple hardware configurations need to be supported by a single OS, ensuring flexibility and compatibility. 1/28/2025 14

Operating system virtualization inserts a virtualization layer inside an operating system to partition a machine’s physical resources. It enables multiple isolated VMs within a single operating system kernel. This kind of VM is often called a virtual execution environment (VE), Virtual Private System (VPS), or simply container. From the user’s point of view, VEs look like real servers. This means a VE has its own set of processes, file system, user accounts, network interfaces with IP addresses, routing tables, firewall rules, and other personal settings. Although VEs can be customized for different people, they share the same operating system kernel. Therefore, OS-level virtualization is also called single-OS image virtualization. 1/28/2025 15 3.Virtualization at Operating System (OS) level:

Compared to hardware-level virtualization, the benefits of OS extensions are twofold: (1) VMs at the operating system level have minimal startup/shutdown costs, low resource requirements, and high scalability (2) For an OS-level VM, it is possible for a VM and its host environment to synchronize state changes when necessary. These benefits can be achieved via two mechanisms of OS-level virtualization: (1) All OS-level VMs on the same physical machine share a single operating system kernel; (2) Virtualization layer can be designed in a way that allows processes in VMs to access as many resources of the host machine as possible, but never to modify them. 1/28/2025 16

Virtualization at the Operating System (OS) level involves Creating isolated user-space instances , which are often referred to as containers. Each container operates as an individual system, with its own set of processes and file system, but all containers share the same OS kernel. Here's a brief overview: Containers : These isolated instances have their own filesystem, system libraries, and application code, but they share the host OS kernel. Efficiency : This type of virtualization is more lightweight compared to hardware virtualization (where each virtual machine has its own OS). It reduces overhead and increases performance. Consistency : Containers ensure that applications run consistently regardless of the environment, making them ideal for development, testing, and deployment. Security : Containers provide a level of isolation, but since they share the OS kernel, they are not as isolated as virtual machines. Proper security measures need to be implemented. 1/28/2025 17

Containerization Containers are packages of software that contain all of the necessary elements to run in any environment. Definition : Containers are lightweight packages of your application code together with dependencies such as specific versions of programming language runtimes and libraries required to run your software services. Containers make it easy to share CPU, memory, storage, and network resources at the operating systems level and offer a logical packaging mechanism in which applications can be abstracted from the environment in which they actually run.  1/28/2025 18

1/28/2025 19 Virtualization at OS Level

What are the benefits of containers? 1/28/2025 20 Separation of responsibility Containerization provides a clear separation of responsibility, as developers focus on application logic and dependencies, while IT operations teams can focus on deployment and management instead of application details such as specific software versions and configurations.   Workload portability Containers can run virtually anywhere, greatly easing development and deployment: on Linux, Windows, and Mac operating systems; on virtual machines or on physical servers; on a developer’s machine or in data centers on-premises; and of course, in the public cloud.   Application isolation Containers virtualize CPU, memory, storage, and network resources at the operating system level, providing developers with a view of the OS logically isolated from other applications.

Virtual Machines (VMs) Vs Containers 1/28/2025 21 Feature Virtual Machines (VMs) Containers Isolation Full OS, independent Shared OS kernel Overhead High Low Boot Time Longer Faster Use Case Running different OS Consistent app deployment

Challenge 1/28/2025 22 At times. different OS-level VMs may have different operating system distributions, they must pertain to the same operating system family. For example, a Windows distribution such as Windows XP cannot run on a Linux-based container. However, users of cloud computing have various preferences. Some prefer Windows and others prefer Linux or other operating systems. Therefore, there is a challenge for OS-level virtualization in such cases

Concept of OS-level virtualization 1/28/2025 23 The Open virtualization layer inside the host OS, which provides some OS images to create VMs quickly. (Courtesy of OpenVZ User’s Guide [65] ) The virtualization layer is inserted inside the OS to partition the hardware resources for multiple VMs to run their applications in multiple virtual environments. To implement OS-level virtualization, isolated execution environments (VMs) should be created based on a single OS kernel. Furthermore, the access requests from a VM need to be redirected to the VM’s local resource partition on the physical machine.

Containers vs. VMs 1/28/2025 24 Containers are much more lightweight than VMs Containers virtualize at the OS level while VMs virtualize at the hardware level Containers share the OS kernel and use a fraction of the memory VMs require Ex: Google Kubernetes Engine  (GKE)

What are containers used for? 1/28/2025 25 Containers offer a logical packaging mechanism in which applications can be abstracted from the environment in which they actually run. This decoupling allows container-based applications to be deployed easily and consistently, regardless of whether the target environment is a private data center, the public cloud, or even a developer’s personal laptop. Agile development,  Efficient operations, Run anywhere

Advantages of OS Extension for Virtualization VMs at OS level has minimum startup/shutdown costs OS-level VM can easily synchronize with its environment Disadvantage of OS Extension for Virtualization All VMs in the same OS container must have the same or similar guest OS, which restrict application flexibility of different VMs on the same physical machine. 1/28/2025 26

4.Library Support level: Since most systems provide well-documented APIs, such an interface becomes another candidate for virtualization. Virtualization with library interfaces is possible by controlling the communication link between applications and the rest of a system through API hooks. The software tool WINE has implemented this approach to support Windows applications on top of UNIX hosts. Another example is the vCUDA which allows applications executing within VMs to leverage GPU hardware acceleration. Advantage: It has very low implementation effort Shortcoming & limitation: poor application flexibility and isolation 1/28/2025 27

Library support level virtualization, also known as user-level Application Binary Interface (ABI) or API emulation , Involves creating execution environments for running programs on a platform without creating a full virtual machine. This type of virtualization focuses on intercepting and remapping API calls. Example: vCUDA for Virtualization of General-Purpose GPUs CUDA is a programming model and library for general-purpose GPUs. Running CUDA applications directly on hardware-level VMs can be challenging. vCUDA virtualizes the CUDA library and can be installed on guest OSes. When a CUDA application in the guest OS issues a call to the CUDA API, vCUDA intercepts the call and redirects it to the CUDA API running on the host OS 1/28/2025 28

CUDA ( Compute Unified Device Architecture) vCUDA stands for "Virtual CUDA," which is a virtualization layer designed for CUDA (Compute Unified Device Architecture) applications. It allows these applications to run in virtualized environments without direct access to physical GPU resources. Here's a quick breakdown: 1/28/2025 29

Example CUDA is a programming model and library for general-purpose GPUs. It leverages the high performance of GPUs to run compute-intensive applications on host operating systems. However, it is difficult to run CUDA applications on hardware-level VMs directly. vCUDA virtualizes the CUDA library and can be installed on guest OSes. When CUDA applications run on a guest OS and issue a call to the CUDA API, vCUDA intercepts the call and redirects it to the CUDA API running on the host OS 1/28/2025 30

1/28/2025 31 The vCUDA employs a client-server model to implement CUDA virtualization. It consists of three user space components: the vCUDA library, a virtual GPU in the guest OS (which acts as a client), and the vCUDA stub in the host OS (which acts as a server). The vCUDA library resides in the guest OS as a substitute for the standard CUDA library. It is responsible for intercepting and redirecting API calls from the client to the stub. Besides these tasks, vCUDA also creates vGPUs and manages them

Library support level virtualization : ex CUDA - consists Guest OS : Contains the vCUDA library , which acts as a substitute for the standard CUDA library. Host OS : Contains the vCUDA stub, which acts as a server. API Call : When the guest OS issues a CUDA API call, the vCUDA library intercepts it and redirects it to the vCUDA stub on the host OS. Execution : The vCUDA stub processes the call and returns the result to the guest OS 1/28/2025 32

Illustration Imagine you have a machine with a powerful GPU and multiple virtual machines running different workloads: vCUDA on Guest OS : Each VM has the vCUDA library installed, which replaces the standard CUDA library. API Interception : When a CUDA application in a VM makes an API call, vCUDA intercepts it and sends the call to the host OS. Host OS Processing : The host OS processes the API call using its physical GPU and returns the results to the VM. By using vCUDA, you can efficiently manage GPU resources across multiple virtual machines without sacrificing performance. 1/28/2025 33

5. User-Application Level Virtualization at the application level virtualizes an application as a VM. On a traditional OS, an application often runs as a process. Therefore, application-level virtualization is also known as process-level virtualization. The most popular approach is to deploy high level language (HLL) VMs. In this scenario, the virtualization layer sits as an application program on top of the operating system, and the layer exports an abstraction of a VM that can run programs written and compiled to a particular abstract machine definition. Application-level virtualization are known as application isolation, application sandboxing, or application streaming. 1/28/2025 34

Key Features of Application-Level Virtualization: Isolation : Applications run in isolated containers, preventing conflicts and ensuring they don't interfere with each other or the host OS. Portability : Virtualized applications can be moved and run across different systems without modification. Central Management : Applications can be centrally managed and updated, simplifying maintenance. 1/28/2025 35

VMware ThinApp VMware ThinApp is a popular application virtualization solution . How it works: Capture : The application is packaged into a self-contained executable or MSI file. This package includes all the files, settings, and dependencies the application needs. Deployment : The package is deployed to end-user machines. It doesn't require installation and can run directly from the package. Execution : When the user runs the application, ThinApp creates a virtual environment that includes the necessary registry keys, files, and system settings. The application interacts with this virtual environment instead of the actual OS. 1/28/2025 36

Use Case: Consider a scenario where a company needs to run an older version of a software that isn't compatible with the latest OS. With application virtualization, the company can create a virtual package of the old software and run it on modern systems without compatibility issues. 1/28/2025 37

User-Application Level Virtualization 1/28/2025 38

Virtualization Structures/Tools and Mechanisms In general, there are three typical classes of VM architecture. Before virtualization , the operating system manages the hardware. After virtualization , a virtualization layer is inserted between the hardware and the operating system. In such a case, the virtualization layer is responsible for converting portions of the real hardware into virtual hardware. Therefore, different operating systems such as Linux and Windows can run on the same physical machine, simultaneously. 1/28/2025 39

VIRTUALIZATION STRUCTURES/TOOLS AND MECHANISMS Depending on the position of the virtualization layer, there are several classes of VM architectures, namely the hypervisor architecture, paravirtualization, and host-based virtualization. The hypervisor is also known as the VMM (Virtual Machine Monitor). They both perform the same virtualization operations 1/28/2025 40

Hardware-level virtualization The hypervisor supports hardware-level virtualization on bare metal devices like CPU, memory, disk and network interfaces. The hypervisor software sits directly between the physical hardware and its OS. This virtualization layer is referred to as either the VMM or the hypervisor. The hypervisor provides hypercalls for the guest OSes and applications. Depending on the functionality, a hypervisor can assume a micro-kernel architecture like the Microsoft Hyper-V. Or it can assume a monolithic hypervisor architecture like the VMware ESX for server virtualization. 1/28/2025 41

A micro-kernel hypervisor includes only the basic and unchanging functions (such as physical memory management and processor scheduling). The device drivers and other changeable components are outside the hypervisor. A monolithic hypervisor implements all the aforementioned functions, including those of the device drivers. Therefore, the size of the hypervisor code of a micro-kernel hypervisor is smaller than that of a monolithic hypervisor. Essentially, a hypervisor must be able to convert physical devices into virtual resources dedicated for the deployed VM to use 1/28/2025 42

Traditional Vs Virtualization 1/28/2025 43

Depending on the position of the virtualization layer, there are several classes of VM architectures, namely the hypervisor architecture , para-virtualization , and host-based virtualization . The hypervisor is also known as the VMM (Virtual Machine Monitor). They both perform the same virtualization operations. 1/28/2025 44

Hypervisor A hypervisor is a hardware virtualization technique allowing multiple operating systems, called guests to run on a host machine. This is also called the Virtual Machine Monitor (VMM). Type 1 : bare metal hypervisor sits on the bare metal computer hardware like the CPU, memory, etc. All guest operating systems are a layer above the hypervisor. The original CP/CMS hypervisor developed by IBM was of this kind. Type 2: hosted hypervisor Run over a host operating system. Hypervisor is the second layer over the hardware. Guest operating systems run a layer over the hypervisor. The OS is usually unaware of the virtualization 1/28/2025 45

Full Binary Translation and Host-based Virtualization Depending on implementation technologies, hardware virtualization VM architectures can be classified into two categories: F ull virtualization and H ost-based virtualization. Full virtualization does not need to modify the host OS. It relies on binary translation to trap and to virtualize the execution of certain sensitive, non virtualizable instructions. In a host-based system, both a host OS and a guest OS are used. A virtualization software layer is built between the host OS and guest OS. These two classes of VM architecture are introduced next. 1/28/2025 46

Binary Translation of Guest OS Requests Using a VMM This approach was implemented by VMware and many other software companies. VMware puts the VMM at Ring 0 and the guest OS at Ring 1. The VMM scans the instruction stream and identified the privileged, control- and behavior sensitive instructions. When these instructions are identified, they are trapped into the VMM, which emulates the behavior of these instructions. The method used in this emulation is called binary translation. Therefore, full virtualization combines binary translation and direct execution. 1/28/2025 47

Host-Based Virtualization An alternative VM architecture is to install a virtualization layer on top of the host OS. This host OS is still responsible for managing the hardware. This host-based architecture has some distinct advantages. First, the user can install this VM architecture without modifying the host OS. The virtualizing software can rely on the host OS to provide device drivers and other low-level services. This will simplify the VM design and ease its deployment. Second, the host-based approach appeals to many host machine configurations. Compared to the hypervisor/VMM architecture, the performance of the host-based architecture may also be low . 1/28/2025 48

Para-virtualization Para-virtualization needs to modify the guest operating systems. A para-virtualized VM provides special APIs requiring substantial OS modifications in user applications. Performance degradation is a critical issue of a virtualized system. 1/28/2025 49

Full Virtualization vs. Para-Virtualization Full virtualization Does not need to modify guest OS, and critical instructions are emulated by software through the use of binary translation. VMware Workstation applies full virtualization , which uses binary translation to automatically modify x86 software on-the-fly to replace critical instructions. Advantage: no need to modify OS. Disadvantage: binary translation slows down the performance. Para virtualization Reduces the overhead, but cost of maintaining a paravirtualized OS is high. The improvement depends on the workload. Para virtualization must modify guest OS, non-virtualizable instructions are replaced by hyper calls that communicate directly with the hypervisor or VMM. Para virtualization is supported by Xen, Denali and VMware ESX. 1/28/2025 50

The XEN Architecture Xen is an open source hypervisor program developed by Cambridge University. Xen is a micro-kernel hypervisor, which separates the policy from the mechanism. Xen does not include any device drivers natively . It just provides a mechanism by which a guest OS can have direct access to the physical devices. As a result, the size of the Xen hypervisor is kept rather small. Xen provides a virtual environment located between the hardware and the OS. 1/28/2025 51

CPU Virtualization A VM is a duplicate of an existing computer system in which a majority of the VM instructions are executed on the host processor in native mode. Thus, unprivileged instructions of VMs run directly on the host machine for higher efficiency. Other critical instructions should be handled carefully for correctness and stability. The critical instructions are divided into three categories: privileged instructions, control–sensitive instructions, and behavior-sensitive instructions. Privileged instructions execute in a privileged mode and will be trapped if executed outside this mode. Control-sensitive instructions attempt to change the configuration of resources used. Behavior-sensitive instructions have different behaviors depending on the configuration of resources, including the load and store operations over the virtual memory. 1/28/2025 52 Virtualization of CPU, Memory, and I/O Devices

A CPU architecture is virtualizable if it supports the ability to run the VM’s privileged and unprivileged instructions in the CPU’s user mode while the VMM runs in supervisor mode. When the privileged instructions including control- and behavior-sensitive instructions of a VM are executed, they are trapped in the VMM. In this case, the VMM acts as a unified mediator for hardware access from different VMs to guarantee the correctness and stability of the whole system. However, not all CPU architectures are virtualizable. RI SC CPU architectures can be naturally virtualized because all control and behavior-sensitive instructions are privileged instructions. On the contrary, x86 CPU architectures are not primarily designed to support virtualization. 1/28/2025 53

Memory Virtualization Virtual memory virtualization is similar to the virtual memory support provided by modern operating systems. I n a traditional execution environment, the operating system maintains mappings of virtual memory to ma chine memory using page tables, which is a one-stage mapping from virtual memory to machine memory. However, in a virtual execution environment, virtual memory virtualization involves sharing the physical system memory in RAM and dynamically allocating it to the physical memory of the VMs. That means a two-stage mapping process should be maintained by the guest OS and the VMM, respectively: virtual memory to physical memory and physical memory to machine memory. 1/28/2025 54

I/O Virtualization there are three ways to implement I/O virtualization: full device emulation, para-virtualization, and direct I/O . I/O virtualization. Generally, this approach emulates well-known, real-world devices. All the functions of a device or bus infrastructure, such as device enumeration, identification, interrupts, and DMA, are replicated in software. This software is located in the VMM and acts as a virtual device. The para-virtualization method of I/O virtualization is typically used in Xen. It is also known as the split driver model consisting of a frontend driver and a backend driver. It achieves beer device performance than full device emulation, it comes with a higher CPU overhead Direct I/O virtualization lets the VM access devices directly. It can achieve close-to native performance without high CPU costs. 1/28/2025 55
Tags