Module 2 CC Notes
Module 2 CC Notes
Module – 02
Virtualization:
Virtualization allows multiple virtual machines (VMs) to run on the same physical
hardware, improving resource sharing, performance, and flexibility.
Page 2
| CLOUD COMPUTING |
o Virtualizes the instruction set of the host machine to emulate different processor
architectures (e.g., running MIPS code on an x86 machine).
o Uses code interpretation or dynamic binary translation for better performance.
o Virtualizes hardware resources like CPU, memory, and I/O devices to allow multiple
users to utilize the hardware concurrently.
o Historical example: IBM VM/370, modern example: Xen hypervisor for x86
machines.
Page 3
| CLOUD COMPUTING |
o Virtualizes the communication link between applications and the OS through API
hooks.
o Examples include WINE (Windows applications on UNIX) and vCUDA (GPU
acceleration within VMs).
User-Application Level:
Page 4
| CLOUD COMPUTING |
Considerations:
VMM (Virtual Machine Monitor) is a layer between hardware and the operating
system.
Manages hardware resources and captures program interactions with hardware.
Enables multiple OS instances to run on a single set of hardware.
Requirements of a VMM:
Page 5
| CLOUD COMPUTING |
Performance Considerations:
Traditional emulators/simulators offer flexibility but are too slow for real-world use.
Page 6
| CLOUD COMPUTING |
Page 7
| CLOUD COMPUTING |
1. Same OS requirement – All VMs on a single container must belong to the same OS
family (e.g., Windows-based VMs cannot run on a Linux host).
2. User preference issues – Some cloud users require different OS types, limiting
flexibility.
3. Resource duplication problem – If each VM has a full copy of system resources, it
leads to high storage and performance costs.
Implementation Considerations
Page 8
| CLOUD COMPUTING |
1. Virtual environments (VPS) – Each VPS functions like an independent Linux server
with its own processes, users, and virtual devices.
2. Resource management – Controls CPU, disk space, and memory allocation.
3. Checkpointing and live migration – Saves VM state to a file for quick transfer and
restoration on another machine.
Page 9
| CLOUD COMPUTING |
This type of virtualization can create execution environments for running alien programs
on a platform rather than creating a VM to run the entire operating system.
API call interception and remapping are the key functions performed. This section
provides an overview of several library-level virtualization systems.
Page 10
| CLOUD COMPUTING |
Namely the Windows Application Binary Interface (WABI), lxrun, WINE, Visual MainWin,
and vCUDA, which are summarized in Table 3.4.
Page 11
| CLOUD COMPUTING |
Page 12
| CLOUD COMPUTING |
VM Architecture Classes
After virtualization, a virtualization layer is inserted between the hardware and OS,
converting real hardware into virtual hardware.
This allows multiple OSes (Linux, Windows, etc.) to run simultaneously on a single
machine.
There are three main classes of VM architecture:
Types of Hypervisors:
Page 13
| CLOUD COMPUTING |
Components of Xen
Domain 0 (Dom0):
Page 14
| CLOUD COMPUTING |
Domain U (DomU):
Security Considerations
Domain 0 is the most critical component. If compromised, the attacker gains full
control over all VMs.
Security policies are required to protect Domain 0.
Unlike traditional machines (which follow a linear execution path), VM execution follows a
tree structure where multiple instances can be created at different states.
Challenges:
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, nonvirtualizable instructions.
Page 15
| CLOUD COMPUTING |
The guest OSes and their applications consist of noncritical and critical 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.
Full Virtualization
With full virtualization, noncritical instructions run on the hardware directly while critical
instructions are discovered and replaced with traps into the VMM to be emulated by
software.
Both the hypervisor and VMM approaches are considered full virtualization. Why are
only critical instructions trapped into the VMM? This is because binary translation can
incur a large performance overhead.
Noncritical instructions do not control hardware or threaten the security of the system,
but critical instructions do.
Therefore, running noncritical instructions on hardware not only can promote efficiency,
but also can ensure system security.
Host-Based Virtualization
Page 16
| CLOUD COMPUTING |
The virtualization layer sits between the host OS and guest OS.
Guest OSes and applications can run inside VMs, while other applications can
run directly on the host OS.
Advantages:
Disadvantages:
Page 17
| CLOUD COMPUTING |
of Para-Virtualization
Para-Virtualization Architecture
In the x86 architecture, the OS typically runs at Ring 0 for privileged operations, while
applications run at Ring 3.
Page 18
| CLOUD COMPUTING |
Advantages of Para-Virtualization
Challenges of Para-Virtualization
This is a Linux para-virtualization system—a part of the Linux version 2.6.20 kernel.
Memory management and scheduling activities are carried out by the existing Linux
kernel.
The KVM does the rest, which makes it simpler than the hypervisor that controls the
entire machine.
Page 19
| CLOUD COMPUTING |
Page 20
| CLOUD COMPUTING |
The Virtual Machine Monitor (VMM) and guest OS operate in separate modes, ensuring
security and isolation.
Sensitive instructions of the guest OS are trapped in the VMM, preventing unauthorized
hardware access.
Page 21
| CLOUD COMPUTING |
o Supervisor Mode (Privileged Mode): Runs the OS kernel and handles critical system
operations.
Page 22
| CLOUD COMPUTING |
CPU Virtualization
VMs execute most instructions in native mode for efficiency, except critical
instructions.
CPU virtualization requires trapping privileged instructions so that the VMM can handle
them securely.
RISC architectures are naturally virtualizable, as all sensitive instructions are privileged.
x86 architecture is not naturally virtualizable because some sensitive instructions (e.g.,
SGDT, SMSW) are not privileged and cannot be trapped by the VMM.
In UNIX systems, system calls trigger the 0x80 interrupt, passing control to the
kernel.
In Xen (a para-virtualization system), system calls trigger both 0x80 (guest OS) and
0x82 (hypervisor).
The hypervisor processes privileged operations before returning control to the
guest OS.
Intel and AMD introduced an additional privilege mode (Ring -1) for virtualization.
Now, the hypervisor runs at Ring -1, while the guest OS runs at Ring 0.
Page 23
| CLOUD COMPUTING |
This eliminates the need for complex binary translation (used in full virtualization).
Benefits:
Page 24
| CLOUD COMPUTING |
Memory Virtualization
o The OS maps virtual memory to machine memory using page tables (one-stage
mapping).
o Modern x86 CPUs use an MMU (Memory Management Unit) and TLB (Translation
Lookaside Buffer) to optimize memory performance.
o Physical RAM is shared and dynamically allocated among Virtual Machines (VMs).
o A two-stage mapping is required:
Guest OS: Maps virtual memory to guest physical memory.
VMM (Hypervisor): Maps guest physical memory to actual machine
memory.
o Each guest OS page table has a corresponding shadow page table maintained by the
VMM.
Page 25
| CLOUD COMPUTING |
o This additional layer leads to performance overhead and high memory costs.
o Nested Paging (Hardware-Assisted Virtualization):
Reduces the overhead of shadow page tables.
Introduced by AMD’s Barcelona processor (2007).
Page 26
| CLOUD COMPUTING |
Page 27
| CLOUD COMPUTING |
Virtualization
I/O virtualization manages routing of I/O requests between virtual devices and shared
physical hardware. There are three main approaches:
Page 28
| CLOUD COMPUTING |
Intel VT-d helps remap I/O DMA transfers and device interrupts, allowing direct device
access for VMs.
Page 29
| CLOUD COMPUTING |
Multi-Core Virtualization
Virtualizing multi-core processors is more complex than uni-core processors due to:
Parallelization Challenges:
Page 30
| CLOUD COMPUTING |
Dynamic Heterogeneity
New architectures mix fat CPU cores and thin GPU cores on the same chip.
Hardware reliability issues and increased complexity in transistor management
make resource allocation more difficult.
o Wells et al. proposed a method where VCPUs can move between cores dynamically.
o Reduces inefficiencies in managing processor cores by software.
o Located below the ISA, making it transparent to OS and hypervisors.
Virtual Hierarchy
Page 31
| CLOUD COMPUTING |
Many-core CMPs typically use physical cache hierarchies (L1, L2) with static allocation.
benefits:
Workloads are grouped into virtual clusters of cores, each assigned to different virtual
machines (VMs):
Page 32
| CLOUD COMPUTING |
Each VM operates in isolation, minimizing cache misses and ensuring efficient resource
allocation.
First level:
Page 33
| CLOUD COMPUTING |
Second level:
Page 34
| CLOUD COMPUTING |
Traditional VM Setup:
o Elastic Computing: Allows users to dynamically create, manage, and scale VMs.
o User Account Management: Customers can control VM resources over time.
o Platforms like XenServer and VMware ESX Server support bridging mode.
o In bridging mode, all VMs appear as individual network hosts.
o VMs can freely communicate over the virtual network interface and self-configure.
Virtual Clusters: Comprise VMs distributed across multiple physical servers and
connected through a virtual network.
Page 35
| CLOUD COMPUTING |
o Each VM runs a guest OS, which may differ from the host OS of the physical
machine.
Page 36
| CLOUD COMPUTING |
o VMs can be replicated across multiple servers for better fault tolerance and disaster
recovery.
o If a physical node fails, only the VMs running on that node are affected.
o A VM failure does not impact the host system.
VM Image Storage:
Page 37
| CLOUD COMPUTING |
VMs use template images (pre-installed OS and software) to reduce setup time.
Copy-on-Write (COW) technique minimizes disk space usage by creating small,
efficient backup files.
Storage management should reduce duplicate blocks to optimize disk usage in
virtual clusters.
Overview of VM Migration
In mixed host-guest clusters, physical nodes run tasks directly, while VMs serve as
failover replacements.
VM failover is more flexible than traditional physical failover but depends on the
host’s availability.
Live VM migration enables a running VM to move between hosts without service
interruption.
Page 38
| CLOUD COMPUTING |
Page 39
| CLOUD COMPUTING |
Minimal Migration Overhead: Critical for dynamic cluster reconfiguration and disaster
recovery, especially in cloud computing.
Page 40
| CLOUD COMPUTING |
1. Guest-Based Manager: Runs within VMs (e.g., openMosix on Xen, Solaris cluster
on VMware).
2. Host-Based Manager: Runs on physical hosts and can restart VMs after failure
(e.g., VMware HA).
3. Independent Cluster Manager: Manages both host and guest systems, increasing
complexity.
4. Integrated Cluster Management: Differentiates between virtual and physical
resources for optimal efficiency.
Introduction
Due to the high initial cost of clusters—including space, power, and cooling—leasing or
sharing clusters is a cost-effective approach.
Early configuration and management systems help define service-specific clusters and
allocate physical nodes accordingly.
Page 41
| CLOUD COMPUTING |
When migrating a system to another physical node, several key considerations must be
addressed.
Memory Migration
The ISR technique exploits temporal locality, meaning that memory states in the
suspended and resumed VM instances are largely similar.
Mechanism:
Limitations:
Page 42
| CLOUD COMPUTING |
Page 43
| CLOUD COMPUTING |
Each VM is assigned a virtual IP address and MAC address, which are distinct
from the host machine’s address.
These addresses must be maintained during migration for network
communication.
The Virtual Machine Monitor (VMM) maintains a mapping between the virtual
IP/MAC addresses and the VM.
o When a VM migrates to a new host, the migration must include all protocol states
and the IP address of the VM.
o On a switched LAN network, the migrating host sends an unsolicited ARP reply,
informing other devices that the VM’s IP has moved. This allows peers to update
their network configurations to route future packets to the VM’s new location.
o If the VM maintains its original Ethernet MAC address, the network switch can
automatically detect the migration to a new port without requiring further network
configuration.
Live migration refers to the process of moving a VM from one physical node to another
without interrupting the VM’s operating system or applications.
This is essential for various enterprise workloads such as load balancing, system
maintenance, and proactive fault tolerance.
Page 44
| CLOUD COMPUTING |
Performance Degradation:
Convergence Issues:
o Some applications may not have small writable working sets, causing difficulties
in convergence, which might require additional migration iterations.
o The large volume of data transferred during the migration process is a key
limitation in precopy-based migration.
Page 45
| CLOUD COMPUTING |
CR/TR-Motion transfers an execution trace file rather than the dirty memory
pages, significantly reducing the amount of transferred data.
Advantages:
o Drastically reduces total migration time and downtime.
o Log files (execution traces) are much smaller than dirty pages, leading to a
more efficient migration.
Limitations:
o The approach is effective only if the log replay rate exceeds the log growth
rate. The differences between the source and target nodes may limit its
effectiveness in some scenarios.
Postcopy Migration
Postcopy migration transfers all memory pages at once, reducing the baseline migration
time. However, it introduces significant downtime due to latency as memory pages are
fetched from the source node before the VM can be resumed on the target node.
Advantages:
o Reduced total migration time as the baseline transfer is done only once.
Challenges:
Page 46
| CLOUD COMPUTING |
Compression Algorithms:
Xen is a widely used Virtual Machine Monitor (VMM) that supports live migration by
utilizing a send/recv model to transfer VM states between source and target hosts.
Dom0 (the control domain) manages the migration process, including the
creation, termination, or migration of VMs across hosts.
Page 47
| CLOUD COMPUTING |
Page 48
| CLOUD COMPUTING |
Page 49
| CLOUD COMPUTING |
Major IT companies like Google, Amazon, Microsoft, HP, Apple, and IBM are investing in
data centers.
Automation enables dynamic resource allocation for millions of users with QoS and
cost-efficiency.
growth (2006-2011):
Developments in Virtualization
Page 50
| CLOUD COMPUTING |
factors:
Page 51
| CLOUD COMPUTING |
Scheduling levels:
Chatty workloads: Burst at peak times and remain idle otherwise (e.g., web video
services).
Page 52
| CLOUD COMPUTING |
o Hardware resources
o Space and power
o Management costs
Resource optimization is needed at the level of CPU, memory, and network interfaces.
Key approach: Reduces the number of physical servers while optimizing resource use.
More effective than other consolidation techniques (e.g., centralized and physical
consolidation).
Page 53
| CLOUD COMPUTING |
o VM level
o Server level
o Data-center level
o Local controller (VM level) and Global controller (server level) work together for
autonomic resource allocation.
Page 54
| CLOUD COMPUTING |
Traditional Storage Virtualization: Aggregation and repartitioning of physical disks for use
by physical machines.
o VMs provide isolation between guest OSes, allowing multiple VMs to run on a
physical machine.
o Storage systems struggle to keep up with system and CPU advancements,
becoming the bottleneck in VM deployment.
Page 55
| CLOUD COMPUTING |
VM Storage Primitives:
o Operations like remapping volumes across hosts and checkpointing disks are
complicated and sometimes unavailable.
o Acts as a block virtualization layer between the VMs and physical storage devices.
o Provides a virtual disk for each VM on the same physical machine.
o Supports various system virtualization techniques, such as paravirtualization and
full virtualization.
Page 56
| CLOUD COMPUTING |
Benefits of Parallax
Page 57
| CLOUD COMPUTING |
Several Virtual Infrastructure (VI) managers and Cloud OSes are designed for managing
virtualized data centers efficiently.
Page 58
| CLOUD COMPUTING |
Page 59
| CLOUD COMPUTING |
Functions of VI Managers:
Page 60
| CLOUD COMPUTING |
The VMM (Hypervisor) creates and manages VMs, acting as an interface between OS
and hardware.
A VM is fully encapsulated, meaning its entire state can be copied, moved, and deleted
like a file.
The VMM is the foundation of security in a virtual system, controlling how VMs access
hardware resources.
o If an attacker gains control over the VMM or management VM, all VMs and the
entire system are at risk.
o VMs can be rolled back to a previous state, causing old random numbers to be
reused.
o This weakens session key security in cryptographic protocols.
o TCP hijacking attacks can occur due to reuse of initial sequence numbers.
Page 61
| CLOUD COMPUTING |
Intrusion Detection System (IDS): Detects and recognizes these unauthorized actions. IDS
o Host-based IDS (HIDS): Runs on individual VMs, but can be compromised if the
VM is attacked.
o Network-based IDS (NIDS): Monitors network traffic but may miss sophisticated
attacks.
Page 62
| CLOUD COMPUTING |
Page 63
| CLOUD COMPUTING |
VMM Security Monitoring: The VMM can monitor and audit access requests for
hardware and system software.
IDS Logs:
Page 64
| CLOUD COMPUTING |
Page 65