Lecture19 & 20 - Xen - Architecture
Lecture19 & 20 - Xen - Architecture
https://wiki.xen.org/wiki/Xen_Project_Software_Overview
Xen Architecture
A special domain, called domain 0 contains the drivers for all the
devices in the system. Domain 0 also contains a control stack to
manage virtual machine creation, destruction, and configuration.
Xen – Architecture Highlights
• The HVM and PV technologies provide their own performance
benefits:
• HVM: A processor technology for accelerating CPU virtualization (privileged
instructions, syscalls) and the MMU (page tables). This is supported by Intel
(VT-x) and AMD (AMD-V).
• PV: A software technology where the guest kernel can use an accelerated
interface for virtualized components, including disks and network interfaces,
rather than emulating hardware.
Xen – Architecture Highlights
• The hypervisor itself has no knowledge of I/O functions such as networking
and storage.
• A special domain, called domain 0 contains the drivers for all the devices in
the system. Domain 0 also contains a control stack to manage virtual
machine creation, destruction, and configuration.
• The hypervisor supports two different virtualization modes:
Paravirtualization (PV) and Hardware-assisted or Full Virtualization (HVM).
• Both guest types can be used at the same time on a single hypervisor. It is also
possible to use techniques used for Paravirtualization in an HVM guest: essentially
creating a continuum between PV and HVM. This approach is called PV on HVM.
• Guest VMs are totally isolated from the hardware: in other words, they
have no privilege to access hardware or I/O functionality. Thus, they are
also called unprivileged domain (or DomU).
Xen – Architecture Highlights
• The Control Domain (or Domain 0) is a specialized Virtual Machine
that has special privileges like the capability to access the hardware
directly, handles all access to the system’s I/O functions and interacts
with the other Virtual Machines.
• It also exposes a control interface to the outside world, through which
the system is controlled.
• The Xen Project hypervisor is not usable without Domain 0, which is
the first VM started by the system.
Xen – Architecture Highlights
• Toolstack and Console: Domain 0 contains a control stack (also called
Toolstack) that allows a user to manage virtual machine creation,
destruction, and configuration.
• The toolstack exposes an interface that is either driven by
• a command line console,
• by a graphical interface or
• by a cloud orchestration stack such as OpenStack or CloudStack.
Xen – Architecture Highlights
• Xen Project-enabled operating systems: Domain 0 requires a Xen
Project-enabled kernel.
• Paravirtualized guests require a PV-enabled kernel.
• Linux distributions that are based on recent Linux kernel are Xen
Project-enabled and usually include packages that contain the
hypervisor and Tools (the default Toolstack and Console).
• All but legacy Linux kernels are PV-enabled, capable of running PV
guests.
Xen – Architecture Highlights
• Paravirtualization (PV) is an efficient and lightweight virtualization
technique originally introduced by Xen Project, later adopted by other
virtualization platforms.
• PV does not require virtualization extensions from the host CPU.
However, paravirtualized guests require a PV-enabled kernel and PV
drivers, so the guests are aware of the hypervisor and can run
efficiently without emulation or virtual emulated hardware.
• PV-enabled kernels exist for Linux, NetBSD, FreeBSD and OpenSolaris.
Linux kernels have been PV-enabled from 2.6.24 using the Linux
pvops framework. In practice this means that PV will work with most
Linux distributions (with the exception of very old versions of distros).
Xen – Architecture Highlights
• Full Virtualization or Hardware-assisted virtualizion (HVM) uses
virtualization extensions from the host CPU to virtualize guests.
• HVM requires Intel VT or AMD-V hardware extensions. The Xen Project
software uses Qemu to emulate PC hardware, including BIOS, IDE disk
controller, VGA graphic adapter, USB controller, network adapter etc.
• Virtualization hardware extensions are used to boost performance of the
emulation.
• Fully virtualized guests do not require any kernel support. This means that
Windows operating systems can be used as a Xen Project HVM guest. Fully
virtualized guests are usually slower than paravirtualized guests, because of
the required emulation.
• Note that it is possible to use PV Drivers for I/O to speed up HVM guests.
On Windows this requires that appropriate PV drivers are installed.
Xen – Architecture Highlights
• To boost performance, fully virtualized HVM guests can use special
paravirtual device drivers (PVHVM or PV-on-HVM drivers).
• These drivers are optimized PV drivers for HVM environments and
bypass the emulation for disk and network IO, thus giving you PV like
(or better) performance on HVM systems.
• This means that you can get optimal performance on guests operating
systems such as Windows.
• Note that Xen Project PV (paravirtual) guests automatically use PV
drivers: there is thus no need for these drivers - you are already
automatically using the optimized drivers. PVHVM drivers are only
required for HVM (fully virtualized) guest VMs.
Reference Slides (not in syllabus)
Xen Architecture