CACS402 Cloud Computing

Cloud ComputingUnit 410 min read

Virtualization & Hypervisors: Types, Roles, and Cloud Impact

Unit 4 of Cloud Computing explores virtualization fundamentals—how hardware/software resources are abstracted, shared, and managed via hypervisors. Covers types (full, para, OS-level), architectures (Type 1/2), real-world cloud deployments (eSewa, banks), and performance trade-offs with visual comparisons and worked ex

Core Concepts: What is Virtualization?

Virtualization is the creation of a virtual (rather than physical) version of something—servers, storage, networks, or operating systems—to improve resource utilization, flexibility, and isolation. In cloud computing, it enables multi-tenancy, where a single physical machine hosts multiple virtual machines (VMs) running different applications or OSes.

How Virtualization Works: The Magic of Abstraction

stateDiagram-v2
    [*] --> Physical_Hardware: "Hosts"
    Physical_Hardware --> Hypervisor: "Runs"
    Hypervisor --> VM1: "Creates"
    Hypervisor --> VM2: "Creates"
    VM1 --> Guest_OS1: "Hosts"
    VM2 --> Guest_OS2: "Hosts"
    Guest_OS1 --> Application1: "Runs"
    Guest_OS2 --> Application2: "Runs"
    note right of Hypervisor
        **Hypervisor** manages VMs,
        isolates resources, and
        allocates CPU/memory/disk.
    end note

Key Idea: The hypervisor (VMM) sits between hardware and VMs, hiding physical constraints and enabling dynamic allocation.


Types of Virtualization: Trade-offs in Isolation vs. Performance

1. Full Virtualization

  • Definition: The hypervisor fully emulates hardware, allowing unmodified guest OSes to run.
  • How it works:
    • Guest OS sees a virtualized hardware interface (CPU, disk, network).
    • Hypervisor traps sensitive instructions (e.g., I/O operations) and emulates them.
  • Example: VMware Workstation, Microsoft Hyper-V.
  • Pros/Cons:
    Pros Cons
    No OS modifications needed Performance overhead (~5–15%)
    Supports legacy OSes (Windows XP) Higher resource usage
    Strong isolation Slower than para-virtualization

2. Para-Virtualization

  • Definition: The guest OS is modified to interact directly with the hypervisor (bypassing emulation).
  • How it works:
    • Guest OS uses hypervisor-specific APIs (e.g., Xen’s hypercall).
    • No emulation needed for privileged operations.
  • Example: Xen (early versions), KVM with paravirtual drivers.
  • Pros/Cons:
    Pros Cons
    Near-native performance Requires OS modifications
    Lower overhead (~1–5%) Limited to supported OSes
    Efficient resource sharing Complex to maintain

3. OS-Level Virtualization (Containers)

  • Definition: Shared OS kernel hosts multiple isolated user-space instances (containers).
  • How it works:
    • Uses namespaces (process isolation) and cgroups (resource limits).
    • No full VM overhead; containers share the host OS.
  • Example: Docker, LXC, OpenVZ.
  • Pros/Cons:
    Pros Cons
    Ultra-lightweight (~10x faster) Less isolation (shared kernel)
    Low memory/CPU usage Security risks if kernel is compromised
    Fast scaling (milliseconds) Not all apps support containers

Hypervisors: The Brain of Virtualization

Type 1 (Bare-Metal) Hypervisors

  • Definition: Runs directly on hardware (no host OS).
  • Examples: VMware ESXi, Microsoft Hyper-V, Xen, KVM.
  • Use Case: Cloud providers (AWS, Google Cloud), enterprise data centers.
  • Why it matters:
    • Higher performance (no OS overhead).
    • Direct hardware access (better for I/O-intensive workloads).
    • Used in: eSewa’s backend servers (hosting multiple government services on a single physical machine), Ncell’s CDN infrastructure.

Type 2 (Hosted) Hypervisors

  • Definition: Runs on top of a host OS (e.g., Windows/Linux).
  • Examples: VMware Workstation, Oracle VirtualBox, Parallels.
  • Use Case: Development/testing, personal labs.
  • Pros/Cons:
    Pros Cons
    Easy to set up Slower (host OS overhead)
    Good for non-production use Limited hardware passthrough
    Supports GUI management Not for high-performance workloads

In the Real World

  1. eSewa’s Payment Gateway

    • Idea Used: Server virtualization (Type 1 hypervisor).
    • How: eSewa’s backend runs on VMware ESXi, hosting multiple VMs for payment processing, user authentication, and fraud detection. During Diwali, when transactions spike, they dynamically allocate more VMs to handle load without buying new hardware.
    • Impact: Reduced infrastructure costs by 40% and improved uptime during peak seasons.
  2. Khalti’s Microservices Architecture

    • Idea Used: OS-level virtualization (Docker containers).
    • How: Khalti uses Docker Swarm to deploy its payment, KYC, and merchant services as isolated containers. Each service (e.g., transaction validation) runs in its own container, sharing the host OS but with strict resource limits.
    • Impact: Faster deployments (minutes vs. hours for VMs) and 99.9% uptime during festivals like Dashain.
  3. NTC’s Network Traffic Management

    • Idea Used: Network virtualization (SDN + VMs).
    • How: NTC uses virtual routers (hosted on KVM) to dynamically reroute traffic during outages. For example, during the 2022 floods, virtualized SDN controllers rerouted backup fiber paths in under 30 seconds, minimizing downtime.
    • Impact: Reduced manual intervention by 70% and improved reliability.

Worked Example: Virtualizing a Bank’s Loan Processing System

Scenario: A Nepalese bank wants to deploy a new loan approval system alongside its existing core banking software. Both systems require Windows Server 2019 and high I/O performance.

Step-by-Step Virtualization Plan

  1. Choose Hypervisor:

    • Type 1 (Hyper-V) because it’s directly on the server hardware (no host OS overhead).
    • Why not Type 2? Type 2 would add latency for I/O-bound loan processing.
  2. Allocate Resources:

    • VM1 (Core Banking): 8 vCPUs, 32GB RAM, 2TB SSD.
    • VM2 (Loan System): 4 vCPUs, 16GB RAM, 1TB SSD.
    • Shared Storage: 5TB SAN (virtualized via iSCSI).
  3. Performance Impact:

    • Without Virtualization: 2 physical servers (high cost, underutilized).
    • With Virtualization:
      • CPU Utilization: 70% (vs. 30% per physical server).
      • Cost Savings: ~$12,000/year (no second server).
      • Disaster Recovery: Snapshots of VMs for quick rollback.

Key Takeaway: Virtualization lets banks consolidate workloads while maintaining performance and security.


Virtualization in Cloud Service Models

Virtualization is the backbone of IaaS, PaaS, and SaaS. Here’s how:

Cloud Model Virtualization Role Example
IaaS Provides virtualized hardware (VMs, storage, networks). AWS EC2 (virtual servers), Google Compute Engine.
PaaS Offers virtualized development environments (containers, serverless). Heroku (containers), AWS Lambda (serverless).
SaaS Runs multi-tenant applications on shared virtualized infrastructure. Google Workspace (emails hosted on VMs).

Why It Matters for Cloud:

  • Multi-tenancy: One physical server hosts hundreds of VMs (e.g., NEPSE’s trading platform during market hours).
  • Elasticity: Scale VMs up/down instantly (e.g., Daraz’s Black Friday traffic).
  • Isolation: Security (e.g., a hacked VM doesn’t compromise others).

Challenges and Trade-offs

Challenge Impact Mitigation
Performance Overhead ~5–15% slower than bare metal. Use para-virtualization or containers.
Security Risks VM escape attacks, shared storage risks. Micro-segmentation, encryption.
Complexity Managing hypervisors, snapshots, backups. Automated tools (Terraform, Ansible).
Licensing Costs Some OSes require extra licenses per VM. Use open-source (Linux) or pay-as-you-go.

Exam Tip: How to Score Full Marks

  1. Define Clearly:

    • Start with precise definitions (e.g., "Virtualization is the abstraction of physical resources into logical units managed by a hypervisor.").
    • Avoid: Vague terms like "software that does virtualization."
  2. Compare with Tables:

    • Examiners love structured comparisons (e.g., full vs. para-virtualization).
    • Example Answer Snippet:

      "Unlike full virtualization, which emulates hardware and incurs a 10–15% performance penalty, para-virtualization modifies guest OSes to interact directly with the hypervisor, reducing overhead to 1–5%. For instance, Xen uses para-virtualization for its Linux guests, while VMware ESXi relies on full virtualization for Windows VMs."

  3. Link to Cloud Models:

    • Always connect virtualization to IaaS/PaaS/SaaS (e.g., "IaaS providers like AWS use Type 1 hypervisors to offer virtual machines with dynamic scaling.").
  4. Use Real-World Examples:

    • 1 mark for naming a company (e.g., eSewa, Khalti) + 2 marks for explaining how they use virtualization.
    • Example:

      "Khalti uses Docker containers for its microservices, reducing deployment time from hours to minutes and improving scalability during festival seasons."

  5. Diagrams = Easy Marks:

    • Draw a hypervisor-VM relationship or a cloud service model table in your exam.
    • Mermaid Cheat Sheet for Exams:
      sequenceDiagram
          participant User
          participant Hypervisor
          participant VM1
          participant VM2
          User->>Hypervisor: Requests VM
          Hypervisor->>VM1: Allocates Resources
          VM1->>User: Runs Application
          User->>Hypervisor: Scales VM2
          Hypervisor->>VM2: Adds CPU/RAM
  6. Avoid Common Mistakes:

    • ❌ "Virtualization is just running multiple OSes." → ✅ "It’s resource abstraction enabled by hypervisors for efficiency and isolation."
    • ❌ Confusing containers with VMs. → Containers share the OS kernel; VMs run isolated OSes.

Based on the TU BCA syllabus for Cloud Computing (CACS402), unit 4.

Discussion

Loading…