Upload
doom0006
View
227
Download
8
Embed Size (px)
DESCRIPTION
Se describe Xen funciones, historia. Proyectos en los que se utiliza Xen
Citation preview
Xen & XCP Tutorial
Patrick F. WilburClarkson University
Josh WestOne.com
Steve MarescaZentific
Todd DeshaneXen.org
Unit 1 - 2011 Xen Day Boston
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.
Patrick F. Wilbur Biography
Patrick F. Wilbur is a computer science Ph.D. student at Clarkson University, where he is a member of the Applied C.S. Labs. His research and teaching interests include usable security, virtualization, operating systems, file systems, artificial intelligence, ubiquitous computing, systems biology, and human-computer interaction. He is a co-author of Running Xen and has taught several Xen tutorials.
In his spare time, he enjoys being involved with his local church, near-space weather balloons, hiking, cooking, and writing essays, poetry, and music.
http://pdub.net
Unit 1Xen & XCP Tutorial
Unit 1: Xen & XCP Tutorial - Overview• Introduction & Xen vs. Xen Cloud Platform
• Xen/XCP Installation & Configuration
• XCP Concepts: pools, hosts, storage, networks, VMs
Introduction &Xen vs. Xen Cloud Platform
Xen, XCP, Project Kronos
Types of Virtualization
Emulation:Fully-emulate the underlying hardware architecture
Full virtualization:Simulate the base hardware architecture
Paravirtualization:Abstract the base architecture
OS-level virtualization:Shared kernel (and architecture), separate user spaces
What is Xen?
• Xen is a virtualization system supporting both paravirtualization and hardware-assisted full virtualization
• Name from neXt gENeration virtualization
• Initially created by University of Cambridge Computer Laboratory
• Open source (licensed under GPL)
What is Xen Cloud Platform (XCP)?
• Xen Cloud Platform (XCP) is a turnkey virtualization solution that provides out-of-the-box virtualization/cloud computing
• XCP includes: o Open-source Xen hypervisoro Enterprise-level XenAPI (XAPI) management tool stacko Support for Open vSwitch (open-source, standards-compliant
virtual switch)
What is Project Kronos?
• Port of XCP's XenAPI toolstack to Debian and Ubuntu dom0 • Gives users the ability to install Debian or Ubuntu, thenapt-get install xcp-xapi
• 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/XenServer Class Diagram
XCP Architecture
The Case for Xen
• True Type 1 virtualization:o Reduced size trusted computing base (TCB) o Versatile Dom0 (Linux, BSD, Solaris all possible) o Dom0 disaggregation (storage domains, stub domains,
restartable management domain) o Inherent separation between VMs & system resources
• Best security, isolation, performance, scalability mix
The Case for Xen
• Xen is mature • Open source (even XenAPI)
• XenAPI is better than libvirt, especially for enterprise use*
* Detailed by Ewan Mellor: http://wiki.openstack.org/XenAPI
The Case for Xen
• Proven enterprise use (Citrix XenServer, Oracle VM, etc.) • Hypervisor of choice for cloud (Amazon, Rackspace, Linode,
Google, etc.) • Hypervisor of choice for client (XenClient, Virtual Computer's
NxTop, Qubes OS, etc.)
So, Why Xen?
• Open source • Proven to be versatile
• Amazing community
• Great momentum in various directions
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)
Xen: Hypervisor Role
• Thin, privileged abstraction layer between the hardware and operating systems
• Defines the virtual machine that guest domains see instead of
physical hardware:o Grants portions of physical resources to each guesto Exports simplified devices to guestso Enforces isolation among guests
Xen: Domain0 (dom0) Role
• Creates and manages guest VMsxl (Xen management tool)
A client application to send commands Xen, replaces xm • Supplies device and I/O services:
o Runs (backend) device driverso Provides domain storage
Normal Linux Boot Process
BIOS
GRUB
Linux
Master Boot Record (MBR)
Kernel Module
The Xen Boot Process
GRUB starts
Hypervisor starts
Domain0 starts
Guest domain starts
Guest OS boots
Kernel
Module
xl
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
Guest Relocation (Migration) in Xen• Cold Relocation
• Warm Migration
• Live Migration
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– Move the guest from one Domain0's file system to another's by
manually copying the guest's disk image and configuration files– 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• Transfers guest's state across network to a new host• 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• Repeatedly copies dirtied guest memory (due to continued
execution) until complete• 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
What's New in Xen 4.0+?
• Better performance and scalability • blktap2 for virtual hard drive image support (snapshots, cloning)
• Improved IOMMU PCI passthru
• VGA primary graphics card GPU passthru for HVM guests
• Memory page sharing (Copy-on-Write) between VMs
• Online resize of guest disks
What's New in Xen 4.0+?
• Remus Fault Tolerance (live VM synchronization) • Physical CPU/memory hotplug
• libxenlight (libxl) replaces xend
• PV-USB passthru
• WHQL-certified Windows PV drivers (included in XCP)
Xen/Xen Cloud Platform Installation & Configuration
Xen Light, XCP Installer
Installing Xen
Xen4 installation instructions, including from source: http://wiki.xensource.com/xenwiki/Xen4.0
1. Install Linux distro 2. Install Xen hypervisor package 3. Install a dom0 kernel (packages available for many distros) 4. Modify GRUB configuration to boot Xen hypervisor instead Result: A working Xen hypervisor and "Xen Light" installation
Installing XCP
1. Download latest XCP ISO: http://xen.org/download/xcp/index.html 2. Boot from ISO and proceed through XCP installer
Result: A ready-to-go Xen hypervisor, dom0, XAPI
Xen Cloud PlatformConcepts
Pools, hosts, storage, networks, VMs
Xen Cloud Platform (XCP)
• XCP was originally derived from Citrix XenServer (a free enterprise product), is open-source, and is free
• XCP promises to contain cutting-edge features that will drive
future developments of Citrix XenServer
Xen Cloud Platform (XCP)
• Again, XCP includes:o Open-source Xen hypervisoro Enterprise-level XenAPI (XAPI) management tool stacko Support for Open vSwitch (open-source, standards-compliant
virtual switch)
XCP Features
• Fully-signed Windows PV drivers • Heterogeneous machine resource pool support
• Installation by templates for many different guest OSes
XCP XenAPI Management Tool Stack• VM lifecycle: live snapshots, checkpoint, migration
• Resource pools: live relocation, auto configuration, disaster
recovery • Flexible storage, networking, and power management
• Event tracking: progress, notification
• Upgrade and patching capabilities
• Real-time performance monitoring and alerting
XCP's xsconsole (SSH or Local)
XCP's XAPI Viewer
XCP Command Line Interface (CLI)
# xe template-list (or # xe vm-import filename=lenny.xva )
# xe vm-install template=<template> new-name-label=<name>
# xe vm-param-set uuid=<uuid of new VM> other-config:install-repository=http://ftp.debian.org/
#xe network-list
#xe vif-create network-uuid=<network uuid from above> vm-uuid=<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/• ...
Useful Resources and References
Community:• Xen Mailing List: http://www.xen.org/community/• Xen Wiki: http://wiki.xensource.com/xenwiki/• Xen Blog: http://blog.xen.org• http://wiki.xensource.com/xenwiki/XenCommonProblems
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