Monday, 25 August 2025

Xen Architecture

 Xen Architecture
1. What is Xen?
Definition: Xen is an open-source type-1 hypervisor that allows multiple operating systems to run simultaneously on the same hardware.
Type-1 hypervisor means it runs directly on hardware (bare-metal), not on top of another OS.
Main purpose: Server virtualization — used in cloud platforms like AWS.

2. Xen Architecture
Think of Xen as a traffic controller between hardware and operating systems.
Main Components:
1. Xen Hypervisor
The core layer that runs directly on the CPU.
Handles CPU scheduling, memory management, and I/O requests.
Provides an abstraction layer between hardware and OS.
2. Domain 0 (Dom0)
The first virtual machine started by Xen.
Has special privileges to directly access hardware drivers.
Manages other virtual machines (DomU).
Runs a modified Linux OS with Xen management tools (xend, xl).
3. Domain U (DomU)
User domains — guest operating systems.
They do not have direct hardware access; they go through Dom0 for I/O.
Can be:
Paravirtualized (PV) — OS is modified to work with Xen.
Hardware Virtual Machine (HVM) — uses CPU virtualization features, unmodified OS.
4. Control Interfaces
Tools and APIs for creating, starting, stopping, and managing VMs.
Example: xl create myvm.cfg

Xen Architecture Diagram (Exam-friendly)
   +------------------------------+
   |        Guest OS (DomU)        |
   +------------------------------+
   |        Guest OS (DomU)        |
   +------------------------------+
   | Privileged OS (Dom0) + Tools  |
   +------------------------------+
   |        Xen Hypervisor         |
   +------------------------------+
   |          Hardware             |
   +------------------------------+

3. Guest Operating System in Xen
A Guest OS is any operating system running inside a Xen virtual machine (DomU or Dom0).
Types of Guest OS in Xen:
1. Paravirtualized (PV) Guest
OS is modified to work with Xen hypervisor calls.
Direct access to Xen APIs for better performance.
Example: Modified Linux kernel for Xen.
2. Full Virtualized / HVM Guest
OS is not modified.
Uses CPU features like Intel VT-x or AMD-V.
Xen emulates hardware so the OS thinks it’s running on a real machine.
Example: Windows running on Xen.

Guest OS Role
Executes applications.
Uses virtual hardware provided by Xen.
Sends I/O requests (disk, network) through Dom0.

✅ Key Points for MSBTE Exam:
Xen is Type-1 Hypervisor → runs directly on hardware.
Dom0: First booted VM, has direct hardware control, manages DomU.
DomU: Guest OS VMs, run in isolated environments.
Guest OS can be PV (modified) or HVM (unmodified).
Xen provides isolation, resource sharing, and security between VMs.

Virtual Machine

    
Virtual Machine
1. Virtual Machine (VM) 
Definition:
A Virtual Machine (VM) is a software-based emulation of a physical computer that runs an operating system and applications, just like a real computer.
Key points:
Created and managed by a hypervisor.
Runs on virtual hardware (virtual CPU, memory, disk, network).
Provides isolation between different VMs.
Example: Running Windows inside VMware on a Linux laptop.

2. Life Cycle of a VM
Think of it like the life stages of a living thing, but for a virtual computer.
1. Creation
     VM is defined with CPU, memory, storage, and network settings.
Operating system is installed or imported.
2. Power On / Start
VM is booted and the guest OS starts running.
3. Running
VM executes applications and performs tasks.
4. Suspend / Pause
VM state is saved in memory or disk, execution is halted temporarily.
5. Resume
VM continues execution from the suspended state.
6. Shutdown / Power Off
Guest OS is stopped, and VM resources are released.
7. Deletion
VM configuration and virtual disks are removed.

📍 Exam diagram idea:
[Create] → [Start] → [Running] → [Suspend] ↔ [Resume] → [Shutdown] → [Delete]
3. VM Migration — Concept and Techniques
Concept:
Moving a running or stopped VM from one physical host to another without affecting its execution significantly.
Why needed?
Load balancing between servers.
Hardware maintenance.
Energy saving.
Techniques:
1. Cold Migration
VM is powered off, then moved to another host.
Simple but causes downtime.
2. Live Migration
VM is moved while still running, with minimal downtime.
Memory and CPU state are transferred while VM is still active.
3. Storage Migration
Moving the VM’s virtual disk files to another storage location.

4. VM Consolidation 
Concept:
Combining workloads from multiple VMs onto fewer physical servers to save resources.
Purpose:
Reduce power consumption.
Lower hardware costs.
Improve resource utilization.
How it works:
Identify underutilized VMs.
Migrate them to fewer hosts.
Power off unused servers.
📍 Example:
If 5 servers are each running at 20% capacity, consolidate into 2 servers running at ~50%, and turn off 3 servers.

5. VM Management — Concepts
Concept:
The process of monitoring, controlling, and maintaining VMs for performance, security, and availability.
Tasks in VM Management:
1. Provisioning — Creating new VMs and allocating resources.
2. Monitoring — Tracking CPU, memory, network usage.
3. Backup & Recovery — Protecting VM data.
4. Security — Applying patches, controlling access.
5. Automation — Using scripts/tools to auto-scale or auto-heal.
✅ Exam Tips:
Always include definition + purpose + example in answers.
Diagrams for VM life cycle and migration types can fetch extra marks.
Keep answers in point form for clarity in MSBTE papers.

Desktop Virtualisation

Desktop Virtualization ( DV ) Desktop Virtualization ( DV ) is a technique that creates an illusion of a desktop provided to the user. It d...