Cloud Notes
Deep dive into hypervisor technology covering Type 1 and Type 2 hypervisors, how they enable virtualization, popular hypervisor platforms, and their role in cloud infrastructure.
A hypervisor, also known as a Virtual Machine Monitor (VMM), is the critical software layer that enables virtualization by managing and allocating physical hardware resources to multiple virtual machines. It is the backbone technology that makes cloud computing possible.
What is a Hypervisor?
A hypervisor creates and manages virtual machines by abstracting the underlying physical hardware. It allocates CPU cycles, memory, storage, and network bandwidth to each VM while ensuring isolation between them.
Type 1 Hypervisors (Bare Metal)
Type 1 hypervisors run directly on the physical hardware without needing a host operating system. They offer superior performance and are used in production and cloud environments.
Popular Type 1 Hypervisors
| Hypervisor | Vendor | Used By |
|---|---|---|
| VMware ESXi | VMware/Broadcom | Enterprises, VMware Cloud |
| KVM | Open Source (Linux) | AWS, Google Cloud, Red Hat |
| Xen | Open Source | Early AWS, Citrix |
| Microsoft Hyper-V | Microsoft | Azure, Windows Server |
| Oracle VM | Oracle | Oracle Cloud |
# Managing VMs with KVM/libvirt (used in production clouds)
# List running VMs
virsh list --all
# Create a VM from XML definition
virsh define /etc/libvirt/qemu/webserver.xml
virsh start webserver
# Take a snapshot
virsh snapshot-create-as webserver snap1 "Before upgrade"
# Live migrate to another host
virsh migrate --live webserver qemu+ssh://host2/systemAdvantages of Type 1
- Direct hardware access (no OS overhead)
- Better performance and lower latency
- Higher security (smaller attack surface)
- Support for more VMs per host
- Enterprise features (live migration, HA)
Type 2 Hypervisors (Hosted)
Type 2 hypervisors run on top of a conventional operating system. They are primarily used for development, testing, and desktop virtualization.
Popular Type 2 Hypervisors
| Hypervisor | Platform | Best For |
|---|---|---|
| VMware Workstation | Windows/Linux | Professional development |
| VMware Fusion | macOS | Mac development |
| Oracle VirtualBox | Cross-platform | Free, learning/testing |
| Parallels Desktop | macOS | Running Windows on Mac |
| QEMU | Linux/cross-platform | Emulation and development |
# VirtualBox CLI example
# Create and configure a VM
VBoxManage createvm --name "DevServer" --ostype "Ubuntu_64" --register
VBoxManage modifyvm "DevServer" \
--memory 8192 \
--cpus 4 \
--nic1 nat \
--audio none
VBoxManage createmedium disk --filename DevServer.vdi --size 80000
VBoxManage storageattach "DevServer" \
--storagectl "SATA" --port 0 --type hdd --medium DevServer.vdiHow Hypervisors Manage Resources
CPU Virtualization
- Binary Translation — Translates sensitive instructions on-the-fly
- Hardware-Assisted (VT-x/AMD-V) — CPU natively supports virtualization
- vCPU Scheduling — Time-slicing physical CPU cores across VMs
Memory Management
- Shadow Page Tables — Mapping virtual-to-physical memory
- Extended Page Tables (EPT) — Hardware-assisted memory virtualization
- Memory Ballooning — Dynamically reclaiming unused VM memory
- Transparent Page Sharing — Deduplicating identical memory pages
I/O Virtualization
- Emulated Devices — Software-emulated hardware (slow but compatible)
- Paravirtualized Drivers — Optimized drivers aware of virtualization (virtio)
- SR-IOV — Direct hardware passthrough for network/storage
Hypervisors in Cloud Providers
| Cloud Provider | Primary Hypervisor | Notes |
|---|---|---|
| AWS | Nitro (KVM-based) | Custom hypervisor with hardware offload |
| Google Cloud | KVM | Heavily modified for performance |
| Microsoft Azure | Hyper-V | Custom Azure-optimized version |
| Oracle Cloud | KVM + Xen | Bare metal options available |
| IBM Cloud | KVM + PowerVM | Supports x86 and POWER |
AWS Nitro is particularly noteworthy—it offloads virtualization functions to dedicated hardware cards, giving VMs near-bare-metal performance.
Performance Considerations
| │ CPU (with HW assist) | 1-3% overhead │ |
| │ Memory (with EPT) | 2-5% overhead │ |
| │ Network (virtio) | 5-10% overhead │ |
| │ Storage (virtio-blk) | 3-8% overhead │ |
| │ Network (SR-IOV) | <1% overhead │ |
| │ Total typical overhead | 5-15% │ |
Interview Questions
- What is a hypervisor and what are its main functions?
A hypervisor (VMM) is software that creates and manages virtual machines by abstracting physical hardware. Its functions include resource allocation (CPU, memory, I/O), VM isolation, scheduling, memory management, and providing virtual hardware interfaces to guest operating systems.
- Compare Type 1 and Type 2 hypervisors with examples.
Type 1 runs directly on hardware (ESXi, KVM, Hyper-V) offering better performance with minimal overhead—used in production and cloud. Type 2 runs on a host OS (VirtualBox, VMware Workstation) with more overhead—used for development and testing.
- How does AWS Nitro improve virtualization performance?
AWS Nitro offloads virtualization functions (network, storage, security) to dedicated hardware cards, eliminating the software hypervisor overhead. This gives EC2 instances near-bare-metal performance while maintaining security isolation between tenants.
- What is SR-IOV and how does it improve VM networking?
Single Root I/O Virtualization (SR-IOV) allows a physical network card to present multiple virtual functions directly to VMs, bypassing the hypervisor for data-plane operations. This eliminates software switching overhead, providing near-native network performance.
- Explain memory ballooning in hypervisor memory management.
Memory ballooning is a technique where the hypervisor installs a balloon driver in the guest OS. When the host needs memory, the balloon inflates (claims memory in the guest, freeing it for the host). When pressure eases, the balloon deflates, returning memory to the guest.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Hypervisors in Cloud Computing.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Cloud Computing topic.
Search Terms
cloud-computing, cloud computing, cloud, computing, fundamentals, hypervisors, hypervisors in cloud computing
Related Cloud Computing Topics