UNIT – II
Service Oriented Architecture – REST and Systems of Systems – Web Services
– Basics of Virtualization – Types of Virtualization – Implementation Levels of
Virtualization – Virtualization Structures – Tools and Mechanisms –
Virtualization of CPU –Memory – I/O Devices –Virtualization Support and
Disaster Recovery
Service-Oriented Architecture (SOA)
Service-Oriented Architecture (SOA) is an architectural style for building business applications
that are composed of loosely coupled, reusable, and interoperable services. Instead of building
monolithic applications, SOA encourages breaking down business functionalities into smaller,
self-contained units called "services."
Key Concepts:
Services: Discrete, self-contained units of functionality that can be invoked remotely. They
perform a specific business task (e.g., "check credit score," "process order," "get customer
details").
Loose Coupling: Services operate independently, with minimal dependencies on each other.
Changes in one service ideally do not require changes in others. This enhances flexibility and
maintainability.
Reusability: Services are designed to be generic and reusable across different applications and
processes within an organization.
Interoperability: Services communicate using standardized protocols and formats (e.g., XML,
JSON, SOAP), allowing diverse systems built on different technologies to interact seamlessly.
Discoverability: Services can be registered and discovered by potential consumers, often through
a service registry.
Standardized Interfaces: Services expose well-defined interfaces that describe their capabilities
and how to interact with them, typically using Web Services Description Language (WSDL) for
SOAP or OpenAPI Specification for REST.
How it Works:
In an SOA environment, applications are built by orchestrating a collection of services. A service
consumer sends a request to a service provider, which processes the request and sends back a
response. An Enterprise Service Bus (ESB) often acts as an intermediary, handling message
routing, transformation, and security.
Benefits:
Agility: Faster development and deployment of new applications by reusing existing services.
Flexibility: Easier to adapt to changing business requirements by modifying or replacing
individual services.
Cost Savings: Reduces development costs through service reuse and integration.
Interoperability: Enables communication between disparate systems and technologies.
Scalability: Individual services can be scaled independently.
Characteristics of SOA:
o Provides interoperability between the services.
o Provides methods for service encapsulation, service discovery, service composition,
service reusability and service integration.
o Facilitates QoS (Quality of Services) through service contract based on Service Level
Agreement (SLA).
o Provides loosely couples services.
o Provides location transparency with better scalability and availability.
o Ease of maintenance with reduced cost of application development and
deployment.
There are two major roles within Service-oriented Architecture:
1. Service provider: The service provider is the maintainer of the service and the
organization that makes available one or more services for others to use. To advertise
services, the provider can publish them in a registry, together with a service contract that
specifies the nature of the service, how to use it, the requirements for the service, and the
fees charged.
2. Service consumer: The service consumer can locate the service metadata in the registry
and develop the required client components to bind and use the service.
Services might aggregate information and data retrieved from other services or create workflows
of services to satisfy the request of a given service consumer. This practice is known as service
orchestration Another important interaction pattern is service choreography, which is the
coordinated interaction of services without a single point of control.
Components of SOA:
Advantages of SOA:
Service reusability: In SOA, applications are made from existing services. Thus,
services can be reused to make many applications.
Easy maintenance: As services are independent of each other they can be updated and
modified easily without affecting other services.
Platform independent: SOA allows making a complex application by combining
services picked from different sources, independent of the platform.
Availability: SOA facilities are easily available to anyone on request.
Reliability: SOA applications are more reliable because it +is easy to debug small
services rather than huge codes
Scalability: Services can run on different servers within an environment, this increases
scalability
Disadvantages of SOA:
High overhead: A validation of input parameters of services is done whenever services
interact this decreases performance as it increases load and response time.
High investment: A huge initial investment is required for SOA.
Complex service management: When services interact they exchange messages to
tasks. the number of messages may go in millions. It becomes a cumbersome task to
handle a large number of messages.
REST and Systems of Systems
REST (Representational State Transfer)
REST is an architectural style for designing networked applications, particularly popular for
building web services. It's an alternative to SOAP-based web services and is the foundation of
the modern web.
A Restful system consists of a:
A client who requests for the resources.
server who has the resources.
It is important to create REST API according to industry standards which results in ease of
development and increase client adoption.
Architectural Constraints of RESTful API
There are six architectural constraints that makes any web service are listed below:
Uniform Interface
Stateless
Cacheable
Client-Server
Layered System
Code on Demand
Key Principles of REST (RESTful APIs):
Client-Server: A clear separation between the client (user interface) and the server (data storage
and processing).
Stateless: Each request from a client to a server must contain all the information needed to
understand the request. The server should not store any client context between requests. This
improves scalability and reliability.
Cacheable: Responses from the server can be cached by the client to improve performance.
Layered System: A client cannot tell whether it is connected directly to the end server or to an
intermediary along the way. This allows for proxies, load balancers, and gateways.
Uniform Interface: This is the most crucial principle and consists of four constraints:
Resource Identification: Resources are identified using URIs (Uniform Resource Identifiers).
Resource Manipulation through Representations: Clients interact with resources by exchanging
representations of those resources (e.g., JSON or XML).
Self-descriptive Messages: Each message includes enough information to describe how to
process the message.
Hypermedia as the Engine of Application State (HATEOAS): The client interacts with the
application by following links provided by the server in its responses. (Often overlooked in
practical implementations, but fundamental to true REST).
Uniform Interface
It is a key constraint that differentiates between a REST API and a Non-REST API. It suggests
that there should be a uniform way of interacting with a given server irrespective of device or
type of application (website, mobile app).
There are four guidelines principles of a Uniform Interface are:
Resource-Based: Individual resources are identified in requests. For example: API/users.
Manipulation of Resources Through Representations: The client has a representation
of the resource and it contains enough information to modify or delete the resource on the
server, provided it has permission to do so. Example: Usually user gets a user ID when
the user requests a list of users and then uses that ID to delete or modify that particular
user.
Self-descriptive Messages: Each message includes enough information to describe how
to process the message so that the server can easily analyze the request.
Hypermedia as the Engine of Application State (HATEOAS): It need to include links
for each response so that client can discover other resources easily.
Why REST is Popular:
Simplicity: Simpler to develop and consume compared to SOAP.
Lightweight: Uses common HTTP methods (GET, POST, PUT, DELETE) and often JSON for
data exchange, resulting in smaller message sizes.
Scalability: Statelessness makes it easy to scale horizontally.
Performance: Caching support improves performance.
Systems of Systems (SoS)
A System of Systems (SoS) refers to a collection of independent, operational systems that are
integrated to provide a more complex, overarching capability than any of the constituent systems
could provide alone. Each constituent system maintains its own management, goals, and
evolution, but they collaborate to achieve common goals.
Key Characteristics of SoS:
Operational Independence of Constituents: Each system within the SoS can operate
independently and perform its functions even if disconnected from the SoS.
Managerial Independence of Constituents: Each constituent system maintains its own budget,Z
management, and sustainment approach.
Evolutionary Development: The SoS evolves over time, with new systems being added, existing
ones modified, and some removed, without necessarily redesigning the entire system.
Emergent Behavior: The SoS exhibits behaviors and capabilities that are not present in any
individual constituent system.
Geographic Distribution: Constituent systems are often geographically dispersed.
REST and SoS:
REST is highly suitable for building Systems of Systems because:
Loose Coupling: REST's stateless and loosely coupled nature allows independent systems to
interact without tight dependencies, which is essential for SoS where constituent systems evolve
independently.
Standardized Communication: HTTP and common data formats (JSON) provide a widely
adopted and interoperable communication mechanism for disparate systems.
Scalability: The ability to scale individual RESTful services independently supports the
evolutionary and often large-scale nature of SoS.
Flexibility: New systems can be integrated into the SoS by simply adhering to the RESTful
interface, without requiring major re-architecting of existing components.
Web Services
Web Services are a standardized way of integrating web-based applications using open standards
over an internet protocol backbone. They are self-contained, self-describing, modular
applications that can be published, located, and invoked across the web.
Two Primary Styles of Web Services:
SOAP (Simple Object Access Protocol) Web Services:
Protocol: A protocol specification for exchanging structured information in the implementation
of web services.
Message Format: Uses XML for messaging.
Transport: Can operate over various transport protocols (HTTP, SMTP, TCP, etc.), though HTTP
is most common.
WSDL (Web Services Description Language): An XML-based language used to describe the
functionality offered by a web service, including its operations, messages, and transport details.
UDDI (Universal Description, Discovery, and Integration): A registry for publishing and
discovering web services (less commonly used now).
Characteristics: More rigid, standardized, and often used in enterprise environments requiring
strong type checking, security, and transaction management. Often perceived as more complex.
RESTful Web Services:
Architectural Style: Based on the REST architectural style, leveraging standard HTTP methods.
Message Format: Typically uses JSON or XML for data exchange.
Transport: Primarily uses HTTP/HTTPS.
Simplicity: Generally simpler to implement and consume due to its stateless nature and use of
standard web protocols.
Scalability: Highly scalable due to statelessness and cacheability.
Popularity: Dominant for building modern web APIs.
Key Difference: SOAP is a protocol with strict rules, while REST is an architectural style with
guidelines. REST is generally favored for its simplicity and efficiency, especially in scenarios
where resource manipulation and scalability are paramount.
Basics of Virtualization
Virtualization is the process of creating a software-based (or virtual) representation of something
rather than a physical one. This includes virtual versions of servers, storage devices, networks,
and other physical hardware. It allows a single physical machine (the host) to run multiple
isolated virtual machines (VMs) or environments (the guests).
Core Concept:
A hypervisor (also known as a Virtual Machine Monitor, VMM) is the software layer that sits
between the physical hardware and the virtual machines. It manages and allocates the host's
resources (CPU, memory, storage, network) to each VM, ensuring that VMs run independently
and securely without interfering with each other.
Benefits of Virtualization:
Resource Utilization: Maximizes the use of underlying hardware by consolidating multiple
workloads onto fewer physical servers.
Cost Reduction: Reduces hardware costs, power consumption, cooling requirements, and data
center space.
Server Consolidation: Fewer physical servers mean less hardware to manage and maintain.
Isolation: Each VM is isolated from others, meaning an issue in one VM doesn't affect others.
Portability: VMs can be easily moved or migrated between physical servers without downtime.
Disaster Recovery: Facilitates quicker disaster recovery and business continuity by enabling
rapid VM restoration.
Simplified Management: Centralized management of virtual infrastructure.
Rapid Provisioning: New servers (VMs) can be spun up quickly.
Virtualization is a way to use one computer as if it were many. Before virtualization, most
computers were only doing one job at a time, and a lot of their power was wasted. Virtualization
lets you run several virtual computers on one real computer, so you can use its full power and do
more tasks at once.
In cloud computing, this idea is taken further. Cloud providers use virtualization to split one big
server into many smaller virtual ones, so businesses can use just what they need, no extra
hardware, no extra cost.
Let us understand virtualization by taking a real-world example:
Suppose there is a company that requires servers for four different purposes:
Store customer data securely
Host an online shopping website
Process employee payroll systems
Run Social media campaign software for marketing
All these tasks require different things:
The customer data server requires a lot of space and a Windows operating system.
The online shopping website requires a high-traffic server and needs a Linux operating
system.
The payroll system requires greater internal memory (RAM) and must use a certain
version of the operating system.
In order to fulfill these requirements, the company initially configures four individual physical
servers, each for a different purpose. This implies that the company needs to purchase four
servers, keep them running, and upgrade them individually, which is very expensive.
Now, by utilizing virtualization, the company can run these four applications on a few physical
servers through multiple virtual machines (VMs). Each VM will behave as an independent
server, possessing its own operating system and resources. Through this means, the company can
cut down on expenses, conserve resources, and manage everything from a single location with
ease.
Working of Virtualization
Virtualizations uses special software known as hypervisor, to create many virtual computers
(cloud instances) on one physical computer. The Virtual Machines behave like actual computers
but use the same physical machine.
Virtual Machines (Cloud Instances)
After installing virtualization software, you can create one or more virtual machines on
your computer.
Virtual machines (VMs) behave like regular applications on your system.
The real physical computer is called the Host, while the virtual machines are
called Guests.
A single host can run multiple guest virtual machines.
Each guest can have its own operating system, which may be the same or different from
the host OS.
Every virtual machine functions like a standalone computer, with its own settings,
programs, and configuration.
VMs access system resources such as CPU, RAM, and storage, but they work as if they
are using their own hardware.
Hypervisors
A hypervisor is the software that gets virtualization to work. It serves as an intermediary between
the physical computer and the virtual machines. The hypervisor controls the virtual machines'
use of the physical resources (such as the CPU and memory) of the host computer.
For instance, if one virtual machine wants additional computing capability, it requests it from the
hypervisor. The hypervisor ensures the request is forwarded to the physical hardware, and it's
accomplished.
There exist two categories of hypervisors:
Type 1 Hypervisor (Bare-Metal Hypervisor):
The hypervisor is installed directly onto the computer hardware, without an operating
system sitting in between.
It is highly efficient as it has a direct access to the resources of the computer.
Type 2 Hypervisor:
It is run over an installed operating system (such as Windows or macOS).
It's employed when you need to execute more than one operating system on one machine.
Types of Virtualization
Virtualization can be applied at various layers of the computing stack:
Server Virtualization:
What it virtualizes: Multiple operating systems and applications on a single physical server.
How it works: A hypervisor runs directly on the physical server hardware (Type 1) or as an
application on top of a host OS (Type 2). Each VM has its own OS and applications, independent
of others.
Examples: VMware vSphere/ESXi, Microsoft Hyper-V, KVM, Xen.
Purpose: Server consolidation, resource efficiency, disaster recovery.
Network Virtualization:
What it virtualizes: Network resources (switches, routers, firewalls, load balancers) into a
logical, software-defined network.
How it works: Abstracts network hardware, allowing logical networks to be created, configured,
and managed independently of the underlying physical network. Software-Defined Networking
(SDN) and Network Function Virtualization (NFV) are key enablers.
Examples: VMware NSX, Cisco ACI, OpenStack Neutron.
Purpose: Network agility, automation, isolation for multi-tenancy, simplified network
management.
Storage Virtualization:
What it virtualizes: Abstraction of physical storage from its logical representation. Multiple
physical storage devices are pooled together and presented as a single storage resource to
applications or servers.
How it works: Software layers (storage virtualization appliances or software-defined storage
solutions) manage underlying storage arrays, presenting logical volumes to servers.
Examples: SAN (Storage Area Network) virtualization, NAS (Network-Attached Storage)
virtualization, software-defined storage solutions like Ceph, OpenStack Swift.
Purpose: Improved storage utilization, simplified storage management, data mobility, better data
protection.
Desktop Virtualization (VDI - Virtual Desktop Infrastructure):
What it virtualizes: The desktop environment (OS, applications, user data). Users access a
personalized virtual desktop running on a remote server.
How it works: Desktops are hosted in a data center, and users connect to them from various
client devices (thin clients, PCs, tablets).
Examples: VMware Horizon, Citrix Virtual Apps and Desktops, Microsoft Remote Desktop
Services.
Purpose: Centralized desktop management, enhanced security, simplified patch management,
"bring your own device" (BYOD) support, remote access.
Application Virtualization:
What it virtualizes: Individual applications, encapsulating them from the underlying operating
system.
How it works: The application is packaged and streamed to the user's device, where it runs in an
isolated environment without full installation.
Examples: Microsoft App-V, VMware ThinApp, Cameyo.
Purpose: Conflict resolution between applications, simplified application deployment, reduced
testing efforts, allows older applications to run on newer OS.
Data Virtualization:
What it virtualizes: Data from disparate sources into a single, unified, logical view without
physically moving or copying the data.
How it works: A data virtualization layer abstracts the underlying data sources, providing a
single query interface for diverse data.
Examples: Denodo, Tibco Data Virtualization.
Purpose: Unified data access, real-time data integration, agile data delivery for analytics and
applications.
Implementation Levels of Virtualization
Virtualization can be implemented at different levels of the computer system stack:
Hardware-Assisted Virtualization (e.g., Intel VT-x, AMD-V):
Level: Hardware level.
How it works: The CPU and chipset provide special instructions that facilitate virtualization. The
hypervisor can directly leverage these hardware capabilities to run VMs more efficiently,
reducing the overhead of virtualization.
Characteristics: High performance, nearly native execution speed for guest OS.
Examples: VMware ESXi, Microsoft Hyper-V, KVM.
Full Virtualization:
Level: Hardware level (often with hardware assistance).
How it works: The hypervisor completely emulates the underlying hardware, providing a
virtualized environment that is identical to the physical hardware. The guest OS runs
unmodified, unaware that it is virtualized.
Characteristics: Broad OS compatibility (can run Windows, Linux, etc., unmodified). Can have
some performance overhead without hardware assistance.
Examples: VMware Workstation/Fusion, Oracle VirtualBox (can use hardware assistance), early
versions of VMware ESX.
Para-virtualization:
Level: OS level (requires modification of guest OS).
How it works: The guest operating system is modified (or "ported") to be aware that it is running
on a hypervisor. This allows the guest OS to make special "hypercalls" to the hypervisor, leading
to better performance and efficiency by avoiding hardware emulation.
Characteristics: Near-native performance. Requires guest OS modification, so not all OSes are
supported.
Examples: Xen (before full hardware assistance was widespread), early KVM.
Operating System-Level Virtualization (Containerization):
Level: OS level.
How it works: Instead of virtualizing the entire hardware and OS, this approach shares the host
OS kernel. Each "container" is an isolated user-space environment that includes an application
and its dependencies, but not a full OS.
Characteristics: Extremely lightweight, fast startup, high density (many containers on one host).
Less isolation than VMs.
Examples: Docker, LXC (Linux Containers), Kubernetes (orchestrates containers).
Virtualization Structures
The way virtualization is implemented leads to different structural arrangements:
Type 1 Hypervisor (Bare-Metal Hypervisor):
Structure: The hypervisor runs directly on the host's physical hardware. It acts as the operating
system for the underlying hardware and manages all hardware resources, allocating them to
VMs.
Advantages: High performance, better security (smaller attack surface), typically used in
enterprise data centers.
Examples: VMware ESXi, Microsoft Hyper-V, Citrix XenServer, KVM (though KVM
technically runs within a Linux kernel, it's often categorized as Type 1 in practice because it
effectively manages hardware directly).
Type 2 Hypervisor (Hosted Hypervisor):
Structure: The hypervisor runs as an application on top of a conventional host operating system
(e.g., Windows, macOS, Linux).
Advantages: Easy to set up and use on a desktop, good for testing and development.
Disadvantages: Performance overhead due to the additional layer of the host OS, less secure due
to larger attack surface.
Examples: VMware Workstation, Oracle VirtualBox, Parallels Desktop.
Container Runtime (OS-level virtualization):
Structure: No full hypervisor. Instead, a container engine (like Docker) runs on top of the host
OS kernel. It uses OS features (like namespaces and cgroups in Linux) to create isolated
environments for containers.
Advantages: Very lightweight, extremely fast startup, high density.
Disadvantages: Less isolation than VMs (containers share the host OS kernel), typically only
runs applications compiled for the host OS kernel.
Tools and Mechanisms for Virtualization
Hypervisors: (Already discussed: VMware ESXi, Hyper-V, KVM, Xen, VirtualBox,
Workstation) - The core software enabling virtualization.
Virtual Machine Managers (VMMs): Software that manages the lifecycle of VMs (creation,
starting, stopping, migration).
Virtualization Management Platforms: Comprehensive suites for managing large-scale
virtualized environments. They provide features like resource pooling, live migration, high
availability, load balancing, and automation.
Examples: VMware vCenter Server, Microsoft System Center Virtual Machine Manager
(SCVMM), OpenStack.
Storage Virtualization Appliances/Software:
Examples: NetApp ONTAP, IBM SAN Volume Controller, Ceph, GlusterFS.
Network Virtualization Software:
Examples: VMware NSX, Cisco ACI.
Container Engines and Orchestrators:
Container Runtimes: Docker Engine, containerd, CRI-O.
Orchestrators: Kubernetes (for deploying, scaling, and managing containerized applications),
Docker Swarm.
Cloud Management Platforms: Many cloud providers (AWS, Azure, GCP) offer their own
management consoles and APIs which abstract away the underlying virtualization tools, allowing
users to provision and manage virtual resources without directly interacting with hypervisors.
Virtualization of CPU, Memory, and I/O Devices
Virtualization of CPU
The hypervisor manages and virtualizes the host's physical CPU resources for the guest VMs.
Mechanisms:
Time-Sharing: The hypervisor allocates CPU time slices to each VM. It rapidly switches between
VMs, giving each the impression of having its own dedicated CPU.
Privilege Rings (Ring 0, 1, 2, 3): In a non-virtualized system, the OS kernel runs in Ring 0 (most
privileged), and applications in Ring 3. In virtualization, the hypervisor often runs in Ring 0, and
the guest OS may run in Ring 1 or 3, leading to "ring compression."
Binary Translation: For full virtualization without hardware assistance, the hypervisor translates
sensitive instructions from the guest OS (which would normally run in Ring 0) into safe
instructions that can execute in a lower privilege ring. This adds overhead.
Hardware-Assisted Virtualization (Intel VT-x, AMD-V): Modern CPUs include virtualization
extensions that create a new "root mode" (Ring -1) for the hypervisor, allowing it to directly
intercept and manage sensitive guest instructions without binary translation, significantly
improving performance.
Virtualization of Memory
The hypervisor manages and virtualizes the host's physical RAM for the guest VMs.
Mechanisms:
Address Translation: Each VM sees its own contiguous virtual memory space. The hypervisor
maintains mappings between the VM's virtual addresses, the VM's physical addresses (which are
virtual from the host's perspective), and the actual physical addresses on the host. This involves
two levels of address translation.
Shadow Page Tables: In full virtualization without hardware assistance, the hypervisor maintains
shadow page tables for each VM, which are copies of the VM's page tables adjusted to reflect the
host's physical memory layout.
Hardware-Assisted Memory Virtualization (Intel EPT, AMD RVI/NPT): CPU extensions
(Extended Page Tables or Nested Page Tables) handle the second level of address translation
directly in hardware, significantly reducing overhead.
Memory Overcommit: Hypervisors can allocate more virtual memory to VMs than the physical
memory available on the host. This is managed through:
Page Sharing: Identical memory pages (e.g., from multiple instances of the same OS) are stored
once and shared among VMs.
Memory Ballooning: A special driver in the guest OS inflates a "balloon" to reclaim unused
memory from the guest, making it available to other VMs.
Swapping/Paging: If physical memory runs critically low, the hypervisor can swap unused VM
memory pages to disk.
Virtualization of I/O Devices
Virtualizing I/O devices (network cards, storage controllers, USB devices) is crucial for VM
functionality.
Mechanisms:
Emulation: The hypervisor emulates the behavior of standard I/O devices. This provides broad
compatibility (guest OS doesn't need special drivers) but can introduce significant performance
overhead due to the emulation layer.
Para-virtualized Drivers (VirtIO): The guest OS uses specialized drivers (aware of the
hypervisor) that communicate directly with the hypervisor for I/O operations. This bypasses
much of the emulation overhead, leading to much better performance.
Direct I/O Passthrough (PCI Passthrough, VT-d, AMD-Vi): Hardware-assisted virtualization
features allow a physical I/O device to be directly assigned to a single VM, giving the VM
exclusive and near-native access to the device. This is ideal for high-performance applications
(e.g., dedicated GPU, high-speed network card).
SR-IOV (Single Root I/O Virtualization): A hardware standard that allows a single physical PCIe
device to appear as multiple separate physical devices to different VMs. This enables multiple
VMs to share a single physical network adapter with near-native performance and reduced CPU
overhead.
Virtualization Support and Disaster Recovery
Virtualization Support for Cloud Computing
Virtualization is the foundational technology upon which cloud computing is built.
Resource Pooling: Virtualization enables cloud providers to pool massive amounts of physical
CPU, memory, and storage, which can then be dynamically allocated to multiple tenants as
virtual resources.
Rapid Elasticity & On-Demand Provisioning: The ability to rapidly create, clone, suspend, and
delete VMs is what allows cloud services to scale up and down almost instantly in response to
demand.
Isolation & Security: VMs provide a level of isolation between different customers' workloads on
the same physical hardware, enhancing security in a multi-tenant cloud environment.
Measured Service: The hypervisor monitors resource consumption by each VM, enabling
accurate billing based on usage.
Abstraction: Cloud platforms abstract away the complexities of the underlying physical
infrastructure, presenting users with easy-to-consume virtualized resources.
Service Delivery: IaaS (Infrastructure as a Service) is essentially the delivery of virtualized
computing resources (VMs, virtual networks, virtual storage) over the internet.
Virtualization of Memory — Explained Simply
When you run multiple virtual machines (VMs) on a single physical server, each VM believes it
has its own dedicated RAM.
But the hypervisor is the one that manages and virtualizes this physical memory.
1. Address Translation
Each VM sees its own virtual memory space.
But behind the scenes, the hypervisor maps:
o VM Virtual Address → VM “Physical” Address → Host Physical Address
This introduces two levels of memory translation.
2. Shadow Page Tables
Used mainly in older systems without hardware support.
Hypervisor keeps a shadow copy of the VM’s page tables.
This copy maps guest memory to actual host memory.
Works well, but adds overhead because the hypervisor must constantly synchronize
tables.
3. Hardware-Assisted Memory Virtualization
Technologies:
Intel EPT (Extended Page Tables)
AMD RVI/NPT (Rapid/ Nested Page Tables)
These let the CPU handle the second-level memory translation, speeding up virtualization by:
Reducing hypervisor involvement
Lowering overhead
Improving VM performance
4. Memory Overcommit
Hypervisors can “promise” more RAM to VMs than physically available.
How? Using smart techniques:
a. Page Sharing
Identical memory pages across VMs stored only once.
Example: multiple Linux VMs booting with identical kernel pages.
b. Memory Ballooning
A balloon driver inside the VM “inflates” when the hypervisor needs RAM.
It claims unused memory from the VM and gives it back to the host.
c. Swapping
If memory is critically low, the hypervisor writes unused VM pages to disk.
This is slower but prevents crashes.
⭐ Virtualization of I/O Devices — Explained
VMs need access to I/O devices like network cards, disks, USB, and GPU. The hypervisor
virtualizes these devices.
1. Emulation
Hypervisor imitates a real hardware device.
Good compatibility—OS doesn't need special drivers.
Slow because everything is simulated.
2. Para-Virtualization (VirtIO)
Guest uses special drivers designed to work with the hypervisor.
Avoids full emulation → much faster.
Common in KVM, Xen.
3. Direct Passthrough (PCI Passthrough, VT-d, AMD-Vi)
A physical device is assigned directly to one VM.
VM gets near-native performance.
Used for:
o GPU passthrough
o High-speed NICs
o Storage controllers
4. SR-IOV (Single Root I/O Virtualization)
One physical PCIe device can act like many virtual devices.
Each VM gets a “virtual function” of the NIC/GPU.
High performance + hardware-level isolation.
Popular in cloud data centers (AWS, Azure).
⭐ How Virtualization Supports Cloud Computing
Virtualization is the core foundation of cloud services like AWS EC2, Azure VMs, Google
Compute Engine.
1. Resource Pooling
All physical CPUs, RAM, and storage are combined.
Allocated to customers as flexible virtual machines.
2. Elasticity & On-Demand Provisioning
Quickly start, stop, clone VMs.
Enable auto-scaling during peak usage.
3. Isolation & Security
VMs on the same hardware cannot access each other’s data.
Strong multi-tenant environments.
4. Measured Service
Hypervisor tracks resource use.
Enables pay-as-you-go billing.
5. Abstraction
Users don’t manage physical hardware.
They only interact with virtualized resources.
6. Service Delivery
Cloud IaaS is essentially virtualized compute + virtual networks + virtual storage.
⭐ Virtualization for Disaster Recovery (DR)
Virtualization makes disaster recovery faster, cheaper, and easier.
1. VM Portability
VMs are stored as files (VMDK, VHDX).
Easy to copy, move, replicate to another site.
2. Faster RTO (Recovery Time)
VMs can reboot on new hardware in minutes.
No need to reinstall OS or applications.
3. Reduced RPO (Data Loss)
Continuous replication and snapshots minimize data loss.
4. Easier DR Testing
VMs can be spun up in an isolated environment without affecting production.
5. Lower DR Costs
No need for full duplicate hardware.
Only critical workloads need DR capacity.
6. Automated DR Orchestration
Tools like:
VMware Site Recovery Manager
Azure Site Recovery
automate:
Replication
Failover
Failback
→ Reduces human error.
Common Virtualization-Based DR Methods
1. VM Replication
Continually copy VM disks and data to another site.
2. Storage Replication
Entire volumes/LUNs are replicated at the storage level.
3. Live Migration
Move running VMs between hosts without downtime (e.g., VMware vMotion).
Useful for planned outages.
4. Backup & Restore
VM images backed up and restored to any compatible hardware.
5. Cloud-based DR
On-premises VMs replicate to cloud platforms.
Pay-as-you-go pricing reduces cost.