Professional Documents
Culture Documents
Copyright Notice
Copyright 2011, Patrick F. Wilbur. Last modified: December 12, 2011 2:39 PM EST. The Xen panda logo is property of Xen.org . == LICENSE:
Patrick F. Wilbur
http://pdub.net Current slides available at: http://cosi.clarkson.edu/docs/installingxen/ These slides and content are released under the Creative Commons Attribution-Share Alike 3.0 Unported license, available online at http://creativecommons.org/licenses/by-sa/3.0/ You may share (copy, distribute, and transmit) this work, and remix (adapt) this work, as long as you attribute this work to the author and share adapted works under the same or similar license by leaving this entire notice in place (including the original author's name/contact information/URL and this license notice).
Acknowledgments
Portions of this 2011 Xen Day work are derived from the 2010 Xen Training / Tutorial, by Todd Deshane and Patrick F. Wilbur, which is derived from the 2009 Xen Training / Tutorial as updated by Zach Shepherd and Jeanna Matthews from the original version written by Zach Shepherd and Wenjin Hu, originally derived from materials written by Todd Deshane and Patrick F. Wilbur.
Portions of this work are inspired by Jeremy Fitzhardinge's Pieces of Xen slides.
Unit 1
Xen & XCP Tutorial
Types of Virtualization
Emulation: Fully-emulate the underlying hardware architecture Full virtualization: Simulate the base hardware architecture Paravirtualization: Abstract the base architecture
What is Xen?
Xen is a virtualization system supporting both paravirtualization and hardware-assisted full virtualization Name from neXt gENeration virtualization
Provides Xen users with the option of using the same API and toolstack that XCP and XenServer provide
Early adopters can try new changes to the XenAPI before they get released in mainstream XCP and XenServer versions Now much, much easier to build tools outside of an SDK VM
XCP Architecture
Hypervisor of choice for client (XenClient, Virtual Computer's NxTop, Qubes OS, etc.)
Xen Definitions
Xen provides a virtual machine monitor (or hypervisor), which a physical machine runs to manage virtual machines There exist one or more virtual machines (or domains) running beneath the hypervisor
A virtual machine is an encapsulated operating system which can run applications as if on a physical machine
The management virtual machine (called Domain0 or dom0) interacts with the hypervisor & runs device drivers Other virtual machines are called guests (guest domains)
Supplies device and I/O services: o Runs (backend) device drivers o Provides domain storage
Virtualization in Xen
Paravirtualization: Uses a modified Linux kernel Guest loads Dom0's pygrub or Dom0's kernel Front-end and back-end virtual device model Cannot run Windows Guest "knows" it's a VM and cooperates with hypervisor Hardware-assisted full virtualization (HVM): Uses the same, normal, OS kernel Guest contains grub and kernel Normal device drivers Can run Windows Guest doesn't "know" it's a VM, so hardware manages it
Virtualization in Xen
Paravirtualization: High performance (claim to fame) High scalability Runs a modified operating system
Hardware-assisted full virtualization (HVM): "Co-evolution" of hardware & software on x86 architecture Uses an unmodified operating system
Cold Relocation
Motivation: Moving guest between hosts without shared storage or with different architectures or hypervisor versions Process: 1. Shut down a guest on the source host 2. Move the guest from one Domain0's file system to another's by manually copying the guest's disk image and configuration files 3. Start the guest on the destination host
Cold Relocation
Benefits: Hardware maintenance with less downtime Shared storage not required Domain0s can be different Multiple copies and duplications Limitation: More manual process Service should be down during copy
Warm Migration
Motivation: Move a guest between hosts when uptime is not critical
Result: 1.Pauses a guest's execution 2.Transfers guest's state across network to a new host 3.Resumes guest's execution on destination host
Warm Migration
Benefits: Guest and processes remains running Less data transfer than live migration Limitations: For a short time, the guest is not externally accessible Requires shared storage Network connections to and from guest are interrupted and will probably timeout
Live Migration
Motivation: Load balancing, hardware maintenance, and power management Result: 1.Begins transferring guest's state to new host 2.Repeatedly copies dirtied guest memory (due to continued execution) until complete 3.Re-routes network connections, and guest continues executing with execution and network uninterrupted
Live Migration
Benefits: No downtime Network connections to and from guest often remain active and uninterrupted Guest and its services remain available Limitations: Requires shared storage Hosts must be on the same layer 2 network Sufficient spare resources needed on target machine Hosts must be configured similarly
Installing Xen
Xen4 installation instructions, including from source: http://wiki.xensource.com/xenwiki/Xen4.0 1. Install Linux distro
Installing XCP
1. Download latest XCP ISO: http://xen.org/download/xcp/index.html 2. Boot from ISO and proceed through XCP installer
XCP Features
Fully-signed Windows PV drivers
Heterogeneous machine resource pool support
# xe vm-install template=<template> new-name-label=<name> # xe vm-param-set uuid=<uuid of new VM> otherconfig:install-repository=http://ftp.debian.org/ #xe network-list #xe vif-create network-uuid=<network uuid from above> vmuuid=<uuid of new VM> device=0 # xe vm-start vm=<name of VM>
Further Information
http://pdub.net/2011/12/03/howto-install-xcp-in-kvm/ ...
Books: The Definitive Guide to the Xen Hypervisor Running Xen: A Hands-On Guide to the Art of Virtualization Discussion: http://www.xen.org/community/xenpapers.html Abstracts, slides, and videos from Xen Summits
http://pcisecuritystandards.org/organization_info/special_interest_groups.php