Understanding Xen Virtualization: Types, Configuration, and Management
This document explores the intricacies of Xen virtualization, detailing the differences between virtual machines and hypervisors, focusing on full virtualization, OS-level virtualization, and paravirtualization. It provides an overview of supported guest operating systems, configuration examples, and management commands to get started with Xen. Discover how to set up and manage virtual machines with various storage configurations, network interfaces, and performance optimizations, enabling efficient use of virtualization technology.
Understanding Xen Virtualization: Types, Configuration, and Management
E N D
Presentation Transcript
Xen Juan Ortega
Virtual Machine vs Hypervisor Desktop virtualization Hypervisor
Types of Virtualization Full Virtualization Runs unmodified OS “hosts” as a userspace program to emulate the machine. Some like QEMU can simulate different processors. OS-level Virtualization Emulates a complete OS userspace using operating system facilities. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-build.htmlv Paravirtualization Relies on modified operating system kernels to work with the hypervisor.
Hosts-Supported Systemsdom0 Guests-Supported Systems domU • Minix • Plan 9 • NetBSD • OpenBSD • FreeBSD (experimental) • OpenSolaris • NetWare • GNU Hurd • OZONE (old) • Linux 3.0 + • Novell’s SUSE Linux • Red Hat Enterprise Linux 5 (RHEL5) • Fedora • Ubuntu (partial) • Debian • Gentoo • Arch Linux • openSUSE • OpenSolaris • OpenBSD? • NetBSD • Linux 3.0 + Unmodified Guest OS using Hardware virtualization (HVM) Allows Guest OSs like Windows to run in “bare metal”. Vt-X and SVM
Getting started $ xm list Name ID Mem VCPU State Time(s) Domain-0 0 934 2 r----- 37.6 -------------------------------------------------------------- $ cat /etc/xen/config_example name = “guest name” kernel = /boot/vmlinuz-2.6-xen.gz maxmem = 256 memory = 256 vcpus = 1 vfb = [ ] disk = [“tap:aio:/opt/xen/images/disk.img,xvda,w”] vif = [“mac=00:16:3e:63:b7:a0, bridge=xenbr0”] --------------------------------------------------------------------------- $ cm create –c /etc/xen/config_example
Storage File as a block device. $ dd if=/dev/zero of=/opt/xen/drive_disk.imgbs=10M count=1024 $ xm block-attack 0 tap:aio:/opt/xen/drive_disk.img /dev/xvda1 w 0 $ mkfs.ext4 /dev/xvda1 $ mount /dev/xvda1 /mnt/ $ cp –a /opt/xen/images/centos-<version>/* /mnt/ disk = [‘tap:aio:/opt/xen/drive_disk.img’] $ xm create –c dive_disk LVMas device-independent physical devices. $ lsmod or $ modprobedm_mod $ pvcreate /dev/sdb1 $ vgcreatedisk_drive /dev/sdb1 $ lvcreate –L <disk size> -nNamedisk_drive $ mount /dev/disk_drive/Name /mnt/hd Disk = [‘phy:/dev/disk_drive/None,sdb1,w’]
Network Each VM can have up to 8 interfaces. vif = [‘’, ‘’, ‘’] vif = [‘ip=“10.0.0.1”,mac=“ae:00:01:02:03:04”’] xm network-attach script=network bridge bridge=xenbr0
Management vlrt-manager