Running Xen-A Hands-On Guide to the Art of Virt
Total Page:16
File Type:pdf, Size:1020Kb
Running Xen: A Hands-On Guide to the Art of Virtualization by Jeanna N. Matthews; Eli M. Dow; Todd Deshane; Wenjin Hu; Jeremy Bongio; Patrick F. Wilbur; Brendan Johnson Publisher: Prentice Hall Pub Date: April 10, 2008 Print ISBN-10: 0-13-234966-3 Print ISBN-13: 978-0-13-234966-6 eText ISBN-10: 0-13-207467-2 eText ISBN-13: 978-0-13-207467-4 Pages: 624 Table of Contents | Index Overview "This accessible and immediately useful book expertly provides the Xen community with everything it needs to know to download, build, deploy and manage Xen implementations." –Ian Pratt, Xen Project Leader VP Advanced Technology, Citrix Systems The Real—World, 100% Practical Guide to Xen Virtualization in Production Environments Using free, open source Xen virtualization software, you can save money, gain new flexibility, improve utilization, and simplify everything from disaster recovery to software testing. Running Xen brings together all the knowledge you need to create and manage high—performance Xen virtual machines in any environment. Drawing on the unparalleled experience of a world—class Xen team, it covers everything from installation to administration–sharing field-tested insights, best practices, and case studies you can find nowhere else. The authors begin with a primer on virtualization: its concepts, uses, and advantages. Next, they tour Xen's capabilities, explore the Xen LiveCD, introduce the Xen hypervisor, and walk you through configuring your own hard—disk—based Xen installation. After you're running, they guide you through each leading method for creating "guests" and migrating existing systems to run as Xen guests. Then they offer comprehensive coverage of managing and securing Xen guests, devices, networks, and distributed resources. Whether you're an administrator, data center manager, developer, system integrator, or ISP, Running Xen will help you achieve your goals with Xen—reliably, efficiently, with outstanding performance, and at a surprisingly low cost. •Understanding the Xen hypervisor: what it does, and how it works •Using pre-built system images, including compressed file systems •Managing domains with the xm console •Populating and storing guest images •Planning, designing, and configuring networks in Xen •Utilizing Xen security: special purpose VMs, virtual network segments, remote access, firewalls, network monitors, sHype access control, Xen Security Modules (XSM), and more •Managing guest resources: memory, CPU, and I/O •Employing Xen in the enterprise: tools, products, and techniques Running Xen: A Hands-On Guide to the Art of Virtualization by Jeanna N. Matthews; Eli M. Dow; Todd Deshane; Wenjin Hu; Jeremy Bongio; Patrick F. Wilbur; Brendan Johnson Publisher: Prentice Hall Pub Date: April 10, 2008 Print ISBN-10: 0-13-234966-3 Print ISBN-13: 978-0-13-234966-6 eText ISBN-10: 0-13-207467-2 eText ISBN-13: 978-0-13-207467-4 Pages: 624 Table of Contents | Index Copyright Foreword Preface Acknowledgments About the Authors Chapter 1. Xen—Background and Virtualization Basics Common Uses and Benefits of Virtualization Types of Virtualization Virtualization Heritage Other Virtualization Systems for Commodity Hardware Summary References and Further Reading Chapter 2. A Quick Tour with the Xen LiveCD Running the LiveCD Step 1: Downloading the LiveCD Image and Creating the CD Step 2: Choosing a Domain0 Image from the GRUB Menu Step 3: Logging In and the Desktop Step 4: Creating Guests Step 5: Deleting a Guest Step 6: Interacting with Your Guests Step 7: Testing Your Networking Too Many Guests Summary References and Further Reading Chapter 3. The Xen Hypervisor Xen Hypervisor A Privileged Position Domain0 Xen Boot Options Choosing an OS for Domain0 xend XenStore Summary References and Further Reading Chapter 4. Hardware Requirements and Installation of Xen Domain0 Xen Domain0 Processor Requirements Hardware Device Support and Recommendations Memory Requirements Choosing and Obtaining a Version of Xen Methods of Installing Domain0 Hosts Linux Distributions XenExpress Non-Linux Domain0 Installations Building from Source Summary References and Further Reading Chapter 5. Using Prebuilt Guest Images Introduction to DomU Guests Working with Prebuilt Guest Images Converting Images from Other Virtualization Platforms Summary References and Further Reading Chapter 6. Managing Unprivileged Domains Introduction to the xm Utility The xm list Subcommand The xm create Subcommand Guest Configuration Files Diagnosing Problems with Guest Creation Automatically Starting DomUs Shutting Down Guest Domains Pausing Domains Interacting with a Guest Nongraphically Interacting with a Guest Graphically Summary References and Further Reading Chapter 7. Populating Guest Images Hardware Virtual Machine (HVM) Guest Population Guest Image Customization Converting Existing Installations Summary References and Further Reading Chapter 8. Storing Guest Images Logical Volumes Network Image Storage Options Guest Image Files Summary References and Further Reading Chapter 9. Device Virtualization and Management Device Virtualization Backends and Frontends Granting Control of a PCI Device Exclusive Device Access Versus Trusted Driver Domains Device Emulation with QEMU-DM Future Directions Summary References and Further Reading Chapter 10. Network Configuration Network Virtualization Overview Designing a Virtual Network Topology Bridging, Routing, and Network Address Translation Frontend and Backend Network Drivers and Naming Overview of Network Configuration in Xen Details of Bridging Mode Details of Routing Mode Details of NAT Mode Configuring Purely Virtual Network Segments Assigning MAC Addresses to Virtual Network Interfaces Assigning IP Addresses Handling Multiple Network Interfaces in a Domain vnet—Domain Virtual Network Summary References and Further Reading Chapter 11. Securing a Xen System Structuring Your System for Security Securing the Privileged Domain Firewall and Network Monitors Mandatory Access Control with sHype and Xen Security Modules DomU Security Summary References and Further Reading Chapter 12. Managing Guest Resources Accessing Information about Guests and the Hypervisor Allocating Guest Memory Managing Guest Virtual CPUs Tuning the Hypervisor Scheduler Choosing a Guest IO Scheduler Summary References and Further Reading Chapter 13. Guest Save, Restore, and Live Migration Representing the State of a Virtual Machine Basic Guest Domain Save and Restore Types of Guest Relocation Preparing for xm migrate Experience with xm migrate Summary References and Further Reading Chapter 14. An Overview of Xen Enterprise Management Tools Programmatic Interfaces to the Xen Hypervisor Citrix XenServer Enterprise, Standard, and XenExpress Editions Virtual Iron IBM Virtualization Manager Enomalism virt-manager XenMan Managing Multiple Systems Summary References and Further Reading Appendix A. Resources Xen Community XenWiki Xen Mailing Lists and Bug Reporting Xen Summits Xen Source Code Academic Papers and Conferences Distribution-Specific Resources Appendix B. The xm Command Appendix C. Xend Configuration Parameter Appendix D. Guest Configuration Parameter Appendix E. Xen Performance Evaluation Xen Performance Measurements Performance Isolation in Xen Performance of Xen Virtual Network and Real Network Summary Index Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales [email protected] Visit us on the Web: www.informit.com/ph Library of Congress Cataloging-in-Publication Data: Matthews, Jeanna N. Running Xen : a hands-on guide to the art of virtualization / Jeanna N. Matthews, Eli M. Dow, Todd Deshane, Wenjin Hu, Jeremy Bongio, Patrick F. Wilbur, Brendan Johnson. p. cm. ISBN 0-13-234966-3 (pbk. : alk. paper) 1. Xen (Electronic resource) 2. Virtual computer systems. 3. Computer organization. 4. Parallel processing (Electronic computers) I. Title. QA76.9.V5M38 2008 005.4'3--dc22 2007052439 Copyright © 2008 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671 3447 ISBN-13: 978-0-132-34966-6 Text printed in the United States on recycled paper