Getting Started with Red Hat Enterprise Virtualization (Bắt đầu với Red Hat Enterprise Virtualization) - Pradeep Subramanian

LI
lienhejb
0 downloads
174
0

Generating preview...

Document content

Page 2

Getting Started with Red Hat Enterprise Virtualization Leverage powerful Red Hat Enterprise Virtualization solutions to build your own IaaS cloud Pradeep Subramanian BIRMINGHAM - MUMBAI www.allitebooks.com

Page 3

Getting Started with Red Hat Enterprise Virtualization Copyright © 2014 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2014 Production reference: 1190914 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78216-740-2 www.packtpub.com [ FM-2 ] www.allitebooks.com

Page 4

Credits Author Copy Editors Pradeep Subramanian Mradula Hegde Gladson Monteiro Reviewers Insiya Morbiwala Kyung Huh Aditya Nair René Koch Adithi Shetty Anil Vettathu Stuti Srivastava Marcus Young Project Coordinator Commissioning Editor Harshal Ved Greg Wild Proofreader Acquisition Editor Simran Bhogal Greg Wild Indexer Content Development Editor Mariammal Chettiyar Athira Laji Production Coordinator Technical Editors Arvindkumar Gupta Shweta S. Pant Humera Shaikh Cover Work Arvindkumar Gupta [ FM-3 ] www.allitebooks.com

Page 5

About the Author Pradeep Subramanian is a Senior Platform Consultant at Red Hat, a global provider of open source software solutions that uses a community-powered approach to develop and offer operating system, middleware, virtualization, storage, and cloud technologies. He has 10 years of experience in open source and Linux, which includes 5 years of extensive experience in open source virtualization technologies such as Xen, KVM, and Red Hat Enterprise Virtualization. His other areas of interest include high availability and grid computing, performance tuning, designing and building open hybrid cloud, architectural design, and implementation of Enterprise IT using open source tools. This is his first book. I would like to express my gratitude to many people who saw me through this book. I would like to thank all those who provided their support, talked things over, read, wrote, offered comments, allowed me to quote their remarks, and assisted in the editing, proofreading, and designing of this book. I owe a huge thanks to my manager, Anirudha Karandikar (Andy), for providing excellent support and advice. Above all, I want to thank my wife, Sandhya; my parents, Subramanian, Selvi, Shanmugam, Usha; and my naughty one-and-a-half-year-old son, Harsh. They all supported and encouraged me in spite of all the time the book took me away from them. It was a long and difficult journey for them. I am dedicating this book to my son, Harsh. I hope that one day, he will read this book and understand why I spent so much time in front of my computer. Last but not least, I beg forgiveness from all those who have been with me over the course of the years and whose names I have failed to mention. Thanks for everything; I look forward to writing the second edition of this book and a few more books on Open Cloud Computing soon! [ FM-4 ] www.allitebooks.com

Page 6

About the Reviewers Kyung Huh is currently working as a consultant in Korea. He has been working with Linux and open source software for more than 15 years as an instructor and consultant. He has experience in Red Hat Enterprise Virtualization in many production environments and also has experience in open source software such as clustering, performance tuning, and troubleshooting. René Koch is a senior solution architect and consultant, focusing on open source virtualization, Linux, system management, and system monitoring. He started working with Red Hat Enterprise Virtualization and oVirt in 2010 and implemented various environments on the customer side. As part of the oVirt community, he is not only an active member on the oVirt mailing list, but also gives lectures about Red Hat Enterprise Virtualization and oVirt in Austria and Germany. Furthermore, he is the author of two open source projects: the Nagios plugin check_rhev3—which is used to monitor the whole RHEV environment with Nagios and Icinga—and Monitoring UI-Plugin—which is a user interface plugin for Red Hat Enterprise Virtualization and oVirt that integrates Nagios-based monitoring environments into the RHEV WebAdmin portal. Anil Vettathu started his interaction with Linux in college. He started his career in 2006 as a Linux System Administrator. He has specialized in Open Source Virtualization technologies, especially KVM. He had the opportunity to work on RHEV from its very early versions. Currently, he is working as a TAM for Red Hat. [ FM-5 ] www.allitebooks.com

Page 7

Marcus Young recently graduated with a degree in Computer Science and Mathematics before getting involved in system administration and DevOps. He currently works in software automation using open source tools and Red-Hat-flavored operating systems in RHEV and AWS virtualization environments. His hobbies include playing ice hockey and making homebrewed beer. He has also developed many hardware projects based on devices such as Arduino, Raspberry Pi, UDOO, and others. I'd like to thank my beautiful fiancé for putting up with many of my projects and work items that make their way into my free time. I would also like to thank my newborn son who will continue to inspire me to keep pushing myself. [ FM-6 ] www.allitebooks.com

Page 8

www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. [ FM-7 ] www.allitebooks.com

Page 10

Table of Contents Preface 1 Chapter 1: An Overview of Red Hat Enterprise Virtualization 7 The virtualization overview 7 Kernel-based Virtual Machine (KVM) 8 Features of RHEV 9 Supported virtual machine operating systems 10 RHEV architecture 10 Components of RHEV 11 The hardware and software requirement of RHEV 12 Red Hat Enterprise Virtualization Manager 12 The Red Hat Enterprise Virtualization Hypervisor host 13 The Red Hat Enterprise Virtualization Manager client 14 Firewall Requirements 15 Summary 18 Chapter 2: Installing RHEV Manager and Hypervisor Hosts 19 Environment mapping 19 Setting up the RHEL operating system for the manager 20 Registering with Red Hat Network 20 Installing the RHEV-Manager packages 22 Running the initial engine setup 23 Connecting to the admin and user portal 006C 26 RHEV reporting 27 Installing the RHEV history database and report server 27 Accessing the RHEV report portal 28 Deploying RHEV Hypervisor 29 Installing the hypervisor 29 Configuring the hypervisor 33 Summary 37 www.allitebooks.com

Page 11

Table of Contents Chapter 3: Setting Up the RHEV Virtual Infrastructure 39 Configuring RHEV 40 Data centers 41 Clusters 43 Approving hypervisor hosts 45 Logical networks 47 Adding logical networks 48 Storage domains 51 Adding a data domain to store virtual machines 52 Adding a data domain of other storage types 54 Activating the ISO domain 54 Populate ISO images on an ISO domain 55 Configuring and activating an export domain 56 Summary 57 Chapter 4: Creating and Managing Virtual Machines 59 Virtual machines 60 Creating Linux virtual machines 60 General settings 60 System settings 63 Initial Run settings 63 Console settings 64 Host settings 65 High Availability settings 67 Resource Allocation settings 68 Boot Options settings 69 Custom Properties 70 Adding virtual disks 70 Installing Red Hat Enterprise Linux on a virtual machine 72 Installing guest agents and drivers on RHEL guests 74 Creating Windows virtual machines 76 Installing VirtIO drivers during the Windows installation 77 Guest agents and driver installation on Windows guests 78 Virtual machine templates 80 Creating a Red Hat Enterprise Linux template 80 Cloning a RHEL virtual machine from a template 82 Creating a Windows template 83 Virtual machine snapshots 85 Creating snapshots 85 Restoring virtual machines from the snapshot 85 Creating a virtual machine from the snapshot 86 Deleting a virtual machine snapshot 86 Backing up virtual machines to export disks 87 [ ii ]

Page 12

Table of Contents Exporting a virtual machine and template 87 Importing a virtual machine and template 88 Summary 90 Chapter 5: Virtual Machine and Host High Availability 91 Virtual machine's live migration 91 Advantages of live migration 92 The requirements of live migration 92 Manual live migration 93 Cold migration 94 Cancelling migration 94 Virtual machine's high availability 94 Automatic virtual machine migration 96 The migration priority 96 Disabling the automatic virtual machine migration 97 The host's high availability 98 Manual fencing 99 Cluster policies 100 The resilience policy 100 The cluster policy 100 Summary 102 Chapter 6: Advanced Storage and Networking Features 103 Shareable disks 104 Direct LUN mapping 106 Virtual disk resize 109 Storage live migration 110 VNIC QoS 111 Hot plugging devices 114 Hot plugging and removing virtual hard disks 114 Hot plugging in VNIC 115 Hot plugging virtual CPU 115 Summary 116 Chapter 7: Quota and User Management 117 An overview of user management 117 Adding the IdM domain to RHEV Manager 119 Validating and listing added domains 120 Adding directory users 120 Authorizing users and assigning roles 122 Creating a new role 124 [ iii ]

Page 13

Table of Contents Introduction to Quota 125 Enabling Quota 125 Creating the Quota policy 126 Assigning Quota to virtual machine objects 128 Assigning Quota to limit resources by users 129 Summary 130 Chapter 8: Managing a Virtualization Environment from the Command Line 131 Introduction to the CLI 131 Installing and setting up CLI 132 Basic command-line examples 134 Running Linux commands in a shell 136 Listing resources from the command-line shell 137 Creating and editing a virtual machine 137 Summary 138 Chapter 9: Troubleshooting RHEV 139 RHEV Manager logs 139 RHEV Hypervisor hosts' logs 141 Guest agent and SPICE logs 142 The log collector utility 142 Maintaining an RHEV environment 143 The stop procedure 143 The start procedure 143 Summary 144 Chapter 10: Setting Up iSCSI, NFS, and IdM Directory Services for RHEV 145 Setting up iSCSI for the data domain 146 Setting up NFS for the export domain 148 Installing and configuring Red Hat IdM 149 Adding users from CLI 153 Summary 154 Index 155 [ iv ]

Page 14

Preface Red Hat Enterprise Virtualization (RHEV), which is a complete enterprise virtualization management solution for servers and desktops, provides fully integrated management of your virtual infrastructures. RHEV is based on and built using two open source projects: Kernel Virtual Machine (KVM), which is open source software that comes with all standard Linux distributions, and oVirt. Based on the popular oVirt open virtualization management project, Red Hat Enterprise Virtualization positions itself as a strategic virtualization alternative to proprietary virtualization platforms with performance advantages, competitive pricing, and a trusted and stable environment. Step-by-step, you'll learn how to build and manage Red Hat Enterprise Virtualization from scratch with various advanced features and troubleshooting steps. You'll also dive deep into the RHEV internal architecture and components. What this book covers Chapter 1, An Overview of Red Hat Enterprise Virtualization, gives you a basic introduction to RHEV, its internal architecture and components, and the basic hardware and software prerequisites. Chapter 2, Installing RHEV Manager and Hypervisor Hosts, shows you how to set up and configure the RHEV Manager and access the web-based admin portal, install and configure RHEV's hypervisor hosts, and install and connect to the report portal in order to report scenarios of your virtual infrastructure's resource usage. Chapter 3, Setting Up the RHEV Virtual Infrastructure, shows you how to create a virtual data center and cluster, add the hypervisor host to cluster, configure storage, and perform networking.

Page 15

Preface Chapter 4, Creating and Managing Virtual Machines, shows you how to create virtual machines, templates, derive virtual machines from the template, take live snapshots of virtual machines, and back up and restore of virtual machines using export and import disks. Chapter 5, Virtual Machine and Host High Availability, shows you how to set up the virtual machine host availability, various cluster policies for cluster hosts, and perform live migration of virtual machines. Chapter 6, Advanced Storage and Networking Features, briefs you about various storage disks options, such as sharing disks across virtual machines, direct LUN mapping from the storage, moving virtual machines across different storage domains, shaping the network traffic's VNIC profile for guest operating systems, and hot plugging of network adapter and memory into virtual machines. Chapter 7, Quota and User Management, talks about applying quota to your virtualization infrastructure with user-role-based access control and integration with common directory services. Chapter 8, Managing a Virtualization Environment from the Command Line, shows you how to set up the command-line tools in order to manage your virtualization infrastructure other than the standard RHEV Manager web-based interface. Chapter 9, Troubleshooting RHEV, talks about various logfiles of the RHEV manager and hypervisor hosts and provides you with steps to put your RHEV virtualization infrastructure into maintenance mode for any planned outage. Chapter 10, Setting Up iSCSI, NFS, and IdM Directory Services for RHEV, shows you how to set up your Red Hat Enterprise Linux server as an iSCSI, the NFS storage server for RHEV virtual machine data storage, the ISO library to store ISO, and export the domain to export the virtual machine for backup and restoration, and set up and configure IdM directory services on RHEL to integrate RHEV with the Red Hat IdM directory service for user management. Appendix shows you how to upgrade RHEV environment from Version 3.3 to 3.4. This chapter is available as a bonus chapter and can be downloaded from https:// www.packtpub.com/sites/default/files/downloads/7402OS_Appendix.pdf. [ 2 ]

Page 16

Preface What you need for this book To set up a demo environment for this book, you need a valid Red Hat account to access the Red Hat software and support portal or, optionally, an evaluation version of RHEV: • https://access.redhat.com/downloads/ • https://access.redhat.com/products/red-hat-enterprise- virtualization#evaluations Please note that the current RHEV GA release is 3.4, but the book is based on a 3.3 release. So if you access the preceding evaluation link, it will direct you to 3.4. Please create an evaluation account, log in to https://access.redhat.com/downloads/, and choose the RHEV Manager channel rhel-x86_64-server-6-rhevm-3.3 for the manager deployment. You will also need the following set of hardware and software in order to run the examples in this book. Red Hat Enterprise Virtualization Manager 3.3 The following are the hardware and software requirements of the Red Hat Enterprise Virtualization manager 3.3: • Hardware: The commodity's physical hardware or virtual machine • Operating system: Red Hat Enterprise Linux 6 Update 5 • Software channels: ° rhel-x86_64-server-6-rhevm-3.3 ° rhel-x86_64-server-supplementary-6 -c ° jbappplatform-6-x86_64-server-6-rpm The Red Hat Enterprise Virtualization Hypervisor host The following are the hardware and software requirements of the Red Hat Enterprise Virtualization Hypervisor host: • Hardware: Commodity virtualization-enabled physical hardware supports Red Hat Enterprise Linux 6 Update 5 • Software: RHEV-H image (for RHEV-M 3.3)—downloadable from https://access.redhat.com/downloads/ [ 3 ]

Page 17

Preface Optional requirements The following are the optional requirements that are needed to run the examples in this book: • Red Hat IdM Directory Service: ° Hardware: The commodity physical hardware or virtual machine that acts as a directory server ° Operating System: Red Hat Enterprise Linux 6 Update 5 ° Software: Identity management (ships by default) • ISCSI / NFS storage service: ° Hardware: The commodity physical hardware or virtual machine that acts as a storage ° Operating system: Red Hat Enterprise Linux 6 Update 5 ° Software: NFS/iSCSI-related package ships with default operating systems Who this book is for If you are a system administrator who is interested in implementing and managing open source virtualization infrastructures, this is the book for you. You need a basic knowledge of virtualization and its use cases and some very basic Linux command-line work experience. Conventions In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "This command will switch off SELinux enforcement temporarily until the machine is rebooted. If you would like to permanently disable it, edit /etc/sysconfig/ selinux and enter SELINUX=disabled." [ 4 ]

Page 18

Preface Any command-line input or output is written as follows: # rhn-channel -a -c rhel-x86_64-server-6-rhevm-3.3 -c rhel-x86_64-server- supplementary-6 -c jbappplatform-6-x86_64-server-6-rpm Username: "yourrhnlogin" Password: XXXX New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Finally, label the ISO domain with a name that will be unique and easily identifiable on the Storage tab of the administration portal". Warnings or important notes appear in a box like this. Tips and tricks appear like this. Reader feedback Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of. To send us general feedback, simply send an e-mail to feedback@packtpub.com, and mention the book title via the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors. Customer support Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase. [ 5 ]

Page 19

Preface Downloading the example code You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. Errata Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/ submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support. Piracy Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at copyright@packtpub.com with a link to the suspected pirated material. We appreciate your help in protecting our authors, and our ability to bring you valuable content. Questions You can contact us at questions@packtpub.com if you are having a problem with any aspect of the book, and we will do our best to address it. [ 6 ]

Page 20

An Overview of Red Hat Enterprise Virtualization This introductory chapter will help you understand the following things before deploying and managing Red Hat Enterprise Virtualization (RHEV): • Virtualization and its basic concepts • An overview of Kernel-based Virtual Machine (KVM) RHEV • The RHEV architecture and its components • Hardware and software prerequisites The virtualization overview Hardware virtualization or platform virtualization allows multiple operating system instances to run concurrently on a single computer. This is a means of separating hardware from a single operating system. A hypervisor or Virtual Machine Monitor (VMM) is a piece of computer software that runs on host machine, which will allow you to create and manage the virtual machine on top of the host. The hypervisor virtualizes all resources (for example, processors, memory, storage, and networks) and allocates them to the various virtual machines that run on top of the hypervisor. In general, physical hardware that runs the hypervisor software is called the host machine and the virtual machine is called the guest operating system.

Showing the first 20 pages. Download the document to see it all.

Comments (0)

Sign in to join the discussion

No comments yet. Be the first!