Cloud ComputingUnit 413 min read

Virtualization: Types, Techniques & Cloud Impact

Unit 4 of Cloud Computing explores virtualization—how a single physical resource is partitioned into multiple virtual instances, enabling efficient cloud resource sharing. This note covers hardware/software virtualization, hypervisors, virtual machines, containers, and their roles in cloud scalability, cost savings, an

What is Virtualization?

Virtualization is the creation of a virtual (rather than physical) version of something, such as a server, storage device, network, or operating system. It allows multiple virtual machines (VMs) or containers to run on a single physical machine, sharing its resources efficiently.

Why Virtualize?

  • Resource Optimization: One physical server can host multiple VMs, reducing hardware costs.
  • Isolation: VMs/containers run independently, improving security and stability.
  • Flexibility: Easily scale up/down resources without buying new hardware.
  • Disaster Recovery: Snapshots and backups simplify recovery.

Types of Virtualization

Virtualization can be categorized based on what is being virtualized:

1. Hardware Virtualization

  • Definition: Divides physical hardware (CPU, RAM, storage) into multiple virtual machines (VMs).
  • How it works:
    • A hypervisor (Type 1 or Type 2) allocates hardware resources to VMs.
    • Each VM runs its own OS and applications, isolated from others.
  • Example:
    • A single server hosts 10 VMs, each running a different OS (Windows, Linux, etc.).
    • Real-world use: Cloud providers like AWS use hardware virtualization to offer virtual servers.
Physical ServerHypervisor (Type 1)VM 1 (Windows)VM 2 (Linux)VM 3 (Ubuntu)controls
Hardware virtualization: A single physical server hosts multiple VMs via a Type 1 hypervisor.

2. Software Virtualization

  • Definition: Runs multiple OS instances on a single host OS (e.g., Windows Subsystem for Linux).
  • How it works:
    • Uses software to emulate hardware, allowing different OSes to run side-by-side.
  • Example:
    • Running Ubuntu inside Windows without a separate VM.

3. Network Virtualization

  • Definition: Combines multiple physical networks into one virtual network or splits one network into multiple virtual networks.
  • How it works:
    • Uses software-defined networking (SDN) to manage traffic dynamically.
  • Example:
    • Nepal Telecom (NTC) uses virtual networks to isolate customer traffic for better security.

4. Storage Virtualization

  • Definition: Pools physical storage from multiple network storage devices into a single storage unit.
  • How it works:
    • Uses Storage Area Networks (SAN) or Network Attached Storage (NAS).
  • Example:
    • Google Cloud Storage pools storage across data centers globally.

5. Application Virtualization

  • Definition: Runs applications in a virtual environment, independent of the OS.
  • How it works:
    • Applications are streamed to user devices from a central server.
  • Example:
    • Citrix Virtual Apps allows employees to access Windows apps from any device.

6. Desktop Virtualization (VDI)

  • Definition: Hosts a user’s desktop environment on a central server.
  • How it works:
    • Users access their virtual desktop via a thin client or remote connection.
  • Example:
    • Microsoft Azure Virtual Desktop provides remote desktops for employees.

Hypervisors: The Brain of Virtualization

A hypervisor (or Virtual Machine Monitor, VMM) is software/firmware that creates and manages VMs. There are two types:

direct accessmanagesruns onmanagesType 1 HypervisorType 2 HypervisorPhysical HardwareHost OSVMsContainers
Comparison: Type 1 vs. Type 2 hypervisor deployment models.

1. Type 1 (Bare-Metal) Hypervisor

  • Runs directly on hardware (no host OS).
  • Examples: VMware ESXi, Microsoft Hyper-V, Xen.
  • Use case: Cloud data centers (e.g., AWS uses Xen).
flowchart TD
  A["Physical Hardware"] --> B["Type 1 Hypervisor"]
  B --> C["VM 1"]
  B --> D["VM 2"]
  B --> E["VM 3"]

2. Type 2 (Hosted) Hypervisor

  • Runs on top of a host OS (e.g., Windows, Linux).
  • Examples: Oracle VirtualBox, VMware Workstation.
  • Use case: Local development/testing.
Host OS (Windows/Linux)Type 2 Hypervisor(VirtualBox/Workstation)VM 1VM 2runs on top of
Type 2 hypervisor architecture: Runs within a host OS to manage VMs.

Virtual Machines (VMs) vs. Containers

Both VMs and containers virtualize resources, but they differ in isolation, performance, and use cases.

Feature Virtual Machines (VMs) Containers
Isolation Full OS-level isolation (hardware emulation) Process-level isolation (shares host OS kernel)
Performance Slower (due to OS emulation) Faster (shares host OS)
Resource Usage Higher (each VM has its own OS) Lower (shares host OS)
Portability Limited (OS-dependent) High (runs on any OS with container runtime)
Use Cases Running different OSes, legacy apps Microservices, cloud-native apps
Examples VMware, VirtualBox Docker, Kubernetes

Worked Example: VM vs. Container for a Web App

  • VM Approach:

    • A web app runs in a Linux VM on a server.
    • The VM has its own OS, applications, and dependencies.
    • Pros: Full isolation, can run any OS.
    • Cons: Slower startup, higher resource usage.
  • Container Approach:

    • The same web app runs in a Docker container.
    • Shares the host OS kernel but isolates processes.
    • Pros: Faster, lighter, scales easily.
    • Cons: Limited to apps that work with the host OS.

Virtualization in Cloud Computing

Cloud providers use virtualization to offer on-demand resources. Key benefits:

  • Multi-tenancy: Multiple customers share the same physical infrastructure.
  • Elasticity: Scale resources up/down instantly.
  • Cost Efficiency: Pay only for what you use (e.g., AWS EC2).

How Cloud Providers Use Virtualization

  1. Infrastructure as a Service (IaaS):

    • Providers like AWS, Azure, and Google Cloud use VMs to offer virtual servers.
    • Example: An e-commerce site (e.g., Daraz) runs on a VM with auto-scaling during sales.
  2. Platform as a Service (PaaS):

    • Containers (e.g., Google App Engine) provide a runtime environment for apps.
  3. Serverless Computing:

    • Uses containers/VMs dynamically (e.g., AWS Lambda) to run code without managing servers.

In the Real World

  1. eSewa (Nepal):

    • Uses server virtualization to host multiple services (bill payments, remittance) on a single physical infrastructure, reducing costs and improving reliability.
  2. Khalti (Digital Payments):

    • Employs containerization (Docker/Kubernetes) to deploy microservices for transactions, ensuring fast and scalable payment processing.
  3. Nepal Telecom (NTC) Network:

    • Uses network virtualization to create isolated virtual networks for different services (internet, VoIP, IoT), improving security and traffic management.
  4. Pathao (Ride-Hailing):

    • Runs its backend on cloud VMs (AWS/Azure), dynamically scaling during peak hours (e.g., festivals) without over-provisioning hardware.
  5. Bank Loan Interest Calculation (Nepal):

    • Banks use virtualized servers to run complex financial models. For example, a loan interest calculation for a 5-year Rs. 1,000,000 loan at 8% per annum is processed in a VM, ensuring consistency and security.

Virtualization Techniques

Hardware emulationNo OS modificationFull VirtualizationGuest OS awareModified driversParavirtualizationCPU extensions (Intel VT-x, AMD-V)Faster performanceHardware-AssistedOS-level virtualizationShared kernelContainerizationVirtualization Techniques
Classification of virtualization techniques with key characteristics.

1. Full Virtualization

  • The hypervisor emulates hardware completely.
  • Example: VMware Workstation.

2. Paravirtualization

  • VMs are aware of the hypervisor and communicate directly with it (faster than full virtualization).
  • Example: Xen (used by AWS).

3. Hardware-Assisted Virtualization

  • Uses CPU extensions (Intel VT-x, AMD-V) to speed up virtualization.
  • Example: Modern cloud servers use this for near-native performance.

4. Containerization

  • Lightweight alternative to VMs, sharing the host OS kernel.
  • Example: Docker, Kubernetes.
Host OS KernelDocker EngineContainer 1 (App 1)Container 2 (App 2)shares kernel, isolates processes
Containerization: Lightweight containers share the host OS kernel but run isolated applications.

Advantages and Disadvantages of Virtualization

Advantages Disadvantages
Cost savings (fewer physical servers) Complexity in management
Improved resource utilization Performance overhead (especially VMs)
Better disaster recovery (snapshots) Security risks if isolation is compromised
Scalability and flexibility Licensing costs for hypervisors/software
Energy efficiency (fewer servers) Learning curve for administrators

Worked Example: Virtualizing a Small Business Server

Scenario: A small IT firm in Kathmandu needs to host:

  • A Windows-based accounting system (QuickBooks).
  • A Linux-based web server (WordPress).
  • A database server (MySQL).

Solution:

  1. Deploy a Type 1 hypervisor (e.g., VMware ESXi) on a powerful server.
  2. Create 3 VMs:
    • VM 1: Windows Server (for QuickBooks).
    • VM 2: Ubuntu (for WordPress).
    • VM 3: CentOS (for MySQL).
  3. Allocate resources:
    • VM 1: 2 vCPUs, 4GB RAM.
    • VM 2: 1 vCPU, 2GB RAM.
    • VM 3: 1 vCPU, 2GB RAM.
  4. Benefits:
    • Single physical server replaces 3 separate machines.
    • Easy backups and snapshots.
    • Isolated environments for security.

Cloud Virtualization in Action: AWS EC2

Amazon Web Services (AWS) uses virtualization to offer Elastic Compute Cloud (EC2) instances. Here’s how it works:

  1. User requests an EC2 instance (e.g., t2.micro).
  2. AWS hypervisor (Xen) allocates resources from a physical server.
  3. User gets a virtual machine with:
    • Virtual CPU (vCPU).
    • Virtual RAM (vRAM).
    • Virtual storage (EBS volume).
  4. User pays only for the time used (e.g., Rs. 500/month for a small instance).

Real-world tie-in:

  • A Nepali startup using AWS EC2 to host its SaaS product pays only for the VMs it uses during business hours, saving costs compared to buying physical servers.

Security Considerations in Virtualization

Virtualization introduces new security challenges:

  1. Hypervisor Attacks:

    • Exploiting vulnerabilities in the hypervisor (e.g., VM escape attacks).
    • Mitigation: Keep hypervisors updated, use trusted vendors (VMware, Microsoft).
  2. VM Isolation Breaches:

    • Malware in one VM can affect others if isolation is weak.
    • Mitigation: Use secure hypervisors, enable VM encryption.
  3. Data Leakage:

    • Sensitive data in one VM may be accessible to others on the same host.
    • Mitigation: Use virtual private clouds (VPC), network segmentation.
  4. Shared Storage Risks:

    • Storage virtualization can expose data if not secured.
    • Mitigation: Encrypt storage, use access controls.

Exam Tip

This unit is heavily tested in TU exams with a mix of:

  1. Definitions and Concepts (5-10 marks):

    • Differentiate between Type 1 and Type 2 hypervisors.
    • Explain full virtualization vs. paravirtualization.
    • Define containers vs. VMs.
  2. Diagrams and Scenarios (10-15 marks):

    • Draw a hypervisor architecture (Type 1 or Type 2).
    • Describe how AWS uses virtualization to offer EC2.
    • Explain a real-world use case (e.g., eSewa’s virtualized servers).
  3. Advantages/Disadvantages (5 marks):

    • List 3 pros and 2 cons of virtualization in cloud computing.
  4. Worked Examples (10 marks):

    • Calculate resource allocation for VMs in a given scenario.
    • Compare VM vs. container for a specific application (e.g., a banking system).

Key Focus Areas:

  • Understand the role of hypervisors in cloud infrastructure.
  • Know how containers differ from VMs and where each is used.
  • Be able to apply virtualization concepts to real-world cloud services (AWS, Azure, Google Cloud).
  • Memorize security risks and mitigation strategies.

Common Pitfalls:

  • Confusing Type 1 and Type 2 hypervisors.
  • Forgetting that containers share the host OS kernel (unlike VMs).
  • Overlooking security implications of virtualization (e.g., VM escape attacks).

Based on the TU BITM syllabus for Cloud Computing (IT277), unit 4.

Discussion

Loading…