VMware vSphere PowerCLI Reference
Transcription
VMware vSphere PowerCLI Reference
VMware vSphere PowerCLI Reference ™ Automating vSphere Administration Luc Dekens Alan Renouf Glenn Sizemore Arnim van Lieshout Jonathan Medd Acquisitions Editor: Agatha Kim Development Editor: Mary Ellen Schutz, Gentle Editing LLC Technical Editor: Stuart Radnidge Production Editor: Eric Charbonneau Copy Editor: Liz Welch Editorial Manager: Pete Gaughan Editorial Consultant: Scott Lowe Production Manager: Tim Tate Vice President and Executive Group Publisher: Richard Swadley Vice President and Publisher: Neil Edde Book Designer: Franz Baumhackl Compositor: James D. Kramer, Happenstance Type-O-Rama Proofreader: Rebecca Rider Indexer: Nancy Guenther Project Coordinator, Cover: Katie Crocker Cover Designer: Ryan Sneed Cover Image: © Thomas Northcut / Getty Images Copyright © 2011 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-89079-0 (pbk) ISBN: 978-1-118-08463-2 (ebk) ISBN: 978-1-118-08465-6 (ebk) ISBN: 978-1-118-08464-9 (ebk) No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 7508400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley .com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Cataloging-in-Publication Data is available from the publisher. TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. VMware vSphere is a trademark of VMware, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. 10 9 8 7 6 5 4 3 2 1 Dear Reader, Thank you for choosing VMware vSphere PowerCLI Reference: Automating vSphere Administration. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching. Sybex was founded in 1976. More than 30 years later, we’re still committed to producing consistently exceptional books. With each of our titles, we’re working hard to set a new standard for the industry. From the paper we print on, to the authors we work with, our goal is to bring you the best books available. I hope you see all that reflected in these pages. I’d be very interested to hear your comments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at nedde@ wiley.com. If you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com. Customer feedback is critical to our efforts at Sybex. Best regards, Neil Edde Vice President and Publisher Sybex, an Imprint of Wiley To my family, friends and colleagues: This took quite a bit of our time away. Luc For my perfect wife and children, my inspiration in life Alan To my Grandfather: You made me the man I am… Glenn To Victor, My Father, Present in Absence and therefore never Past Arnim For my family, for putting up with me whilst I worked on this Jonathan Ac k n o w l e d g m e n t s W e’d all like to thank Pete Gaughan, editorial manager; Agatha Kim, acquisitions editor; Eric Charbonneau, production editor; Liz Welch, copyeditor; Nancy Guenther, indexer; Rebecca Rider, proofreader; and Jim Kramer, compositor. Without each of their contributions, this book would never have made it to the presses. In particular, we would like to thank our developmental editor, Mary Ellen Schutz, for making us all literate. Without her attention to detail, we wouldn’t have been able to produce the complete manual you’re now reading. Finally, we would like to thank Stuart Radnidge, our technical editor. Stu Rad held us all to the highest standards. He left no script unturned and no explanation unchecked. He served as the gatekeeper, ensuring that any code you find herein will run the first time, every time. (You can visit his blog by searching for vinternals from your favorite browser.) While we didn’t always see eye to eye, without the professionals at Sybex this book would never have been possible. Thanks, guys, it was a blast. Thanks to my fellow authors and all the people at Sybex who were involved with this book. And a special thanks to “our Gentle Editor, the little old lady from Wisconsin.” She had to organize all this geek talk into the book you’re now holding in your hands. I would also like to thank all the people from VMware who produced such a great product—especially the PowerCLI Development Team in Sofia, Bulgaria, and Carter Shanklin, who made this product what it is today. Thanks also to Pablo Roesch, although we aren’t developers, we appreciate the drive with which you help us evangelize this wonderful piece of software. And finally, thanks to Jeffrey Snover and the PowerShell Team at Microsoft. Without PowerShell, none of this would have been possible. You shook the automation world! Luc I’d like to thank my wonderful wife and children for supporting me throughout this book and my life. To my fellow authors and everyone who has worked on this book: I would like to say thank you for staying with me and allowing me to push the boundaries time and time again. I would also like to thank my father. If he had not dragged me along to my first computer club and bought me the ZX Spectrum, I would not be here today. Thanks to my mother for her ongoing support—I know you will read this even though you don’t know what PowerShell is! Alan I’d like to thank my wife Kristine for marrying me in the first place. Without her support, I would not have taken on this project. To Luc and Alan: It was an honor working with you both—thank you for including me. I’d also like to thank Roger Williams and Charlie Louk; you both taught me my trade. Without your teachings, I wouldn’t be where I am today. To my fellow vExpert, co-worker, and friend: Andrew, you push me every day. Keep it up; I think it’s working! Glenn I’d like to thank my wife Alexandra for putting up with me and for going to bed alone many nights while I was working on this book. To my oldest son: Thank you for your patience and understanding. Yes, now I finally have time to rebuild your PC. To my middle son: Thank you for your forbearance. We now can jump on the trampoline together ’til we drop. To my newborn son: Thank you for entering my life during the process. You really gave me new inspiration. I’d also like to thank Luc and Alan for the opportunity to realize a dream, VMware for starting the x86 virtualization revolution, the VMware PowerCLI development team for creating such a great product and finally, to all the other authors of this book: It was great working with you guys. Arnim I’d like to thank Alan and Luc for offering me the opportunity to be involved with the book, Alan for the remote use of his test lab, all of the authors of the book for their help and contributions, and finally the guys at Special Operations Software for suggesting in 2007 that I should learn PowerShell. Jonathan A b o u t t h e Au t h o r s M ost projects have to start somewhere as an idea, and this one was no different. Alan and I had discussed the idea of a PowerCLI book. When Sybex contacted us, our idea suddenly became a reality. As probably all first-time authors do, we horribly underestimated the effort that goes into writing a book like the one we had in mind. Luckily we had the good fortune to be able to attract some outstanding co-authors like Glenn, Arnim, and Jonathan. We hope that you, the reader, will enjoy reading this book as much as we did writing it. Luc Dekens started many moons ago in the mainframe world as a system programmer. While the companies he worked for took Unix and Windows boxes on board, it was a natural evolution for him to expand into those areas. A couple of years ago Luc was impressed by a new scripting tool, Monad, that Microsoft was bringing to market. When the organization Luc works for was expanding their virtualization platform, he stumbled on a product called VI Toolkit. It was ideal for automating many administrative tasks. Luc was admitted to the early beta program and started contributing to the ever-growing PowerCLI community. After attending VMworld 2009 in San Francisco, where he did a session together with Hal Rottenberg, Luc started a blog (http://lucd.info). During VMworld 2010 in the US and in Europe, Luc did a session together with Alan Renouf that sold out several times. Alan Renouf has worked in IT since 1998, starting as a junior desktop support engineer and working in a variety of IT jobs. Currently he works as a vSpecialist for EMC. Alan was named a vExpert in both 2009 and 2010. He presented a PowerCLI session with Luc Dekens at both VMworld San Francisco and Copenhagen (2010). Alan first started scripting in his childhood, copying code from magazines onto a ZX Spectrum and tweaking scripts until they worked. He worked his way through a variety of languages before settling on PowerShell. Alan is the co-host of the GetScripting PowerShell podcast at http://get-scripting.blogspot.com and the author of a PowerCLI-related blog at http://virtu-al.net. You can follow Alan on Twitter at http://twitter.com/alanrenouf. Glenn Sizemore has held just about every position one could hold in IT—everything from cable dog to enterprise architect. He started scripting early in his IT career and had mastered VBScript by the time PowerShell first shipped. As a scripter, he was an early adopter and had conquered PowerShell when the VMware Toolkit for Windows (PowerCLI) first shipped. Curiosity carried Glenn to an internal team- testing virtualization. Three years later, he was attending his third VMworld and had just been awarded the status of VMware vExpert. Along the way, Glenn started a blog, www.Get-Admin.com, to share scripts and automation techniques. Outside of work, Glenn is the proud father of two beautiful children and an avid PowerShell evangelist. Arnim van Lieshout has been in the IT industry for 12 years, working mainly with operating systems. He holds key industry certifications and recognitions from VMware, Microsoft, and Citrix. For the last 5 years Arnim has been focusing on virtualization and as a virtualization architect he has been helping enterprise customers get the most out of virtualization, especially in server consolidation and business continuity. The last few years, he has been focusing on automating tasks using PowerShell. Arnim is an active member of the VMware Community forums and is a contributor to the VMware Community PowerPack (http://vmcompack.codeplex.com/). In 2010, Arnim was awarded third place in the VMware Script-O-Mania contest and, later that year, he was designated a VMware vExpert. He runs his own blog at www.van-lieshout .com, which is focused on virtualization and utilizing PowerShell in VMware environments. You can follow Arnim on Twitter at http://twitter.com/avlieshout. Jonathan Medd has been working with Windows Infrastructure products since 1997 and, more recently, virtualization technologies from VMware. In 2007, he discovered Windows PowerShell and now spends a lot of time encouraging IT pros he meets to use PowerShell by talking with them, giving presentations to user groups, and via posts on his blog http://jonathanmedd.net. He also co-hosts the Get-Scripting PowerShell podcast, which provides information on how to learn PowerShell and what’s going on in the PowerShell world—you can find this at http://get-scripting.blogspot.com. In April 2010, Jonathan was awarded status as a Microsoft Most Valuable Professional (MVP) for PowerShell. You can follow him on Twitter at http://twitter.com/jonathanmedd. Co n t e n t s at a G l a n c e Forewords xix Introduction xxi Part I Install, Configure, and Manage the vSphere Environment 1 Chapter 1 Automating vCenter Server Deployment and Configuration 3 Chapter 2 Automating vSphere Hypervisor Deployment and Configuration 35 Chapter 3 Automating Storage and Networking 67 Chapter 4 Using Advanced vSphere Features 93 Part II Managing the Virtual Machine Life Cycle 127 Chapter 5 Creating Virtual Machines 129 Chapter 6 Using Templates and Customization Specifications 173 Chapter 7 Configuring Virtual Machine Hardware 197 Chapter 8 Advanced Virtual Machine Features 229 Chapter 9 Using vApps 269 Part III Securing Your vSphere Environment 301 Chapter 10 Backing Up and Restoring Your Virtual Machines 303 Chapter 11 Organize Your Disaster Recovery 325 Chapter 12 Hardening the vSphere Environment 367 Chapter 13 Maintain Security in Your vSphere Environment 403 Part IV Monitoring and Reporting 427 Chapter 14 Reporting the Status of Your vSphere Environment 429 Chapter 15 Using Statistical Data 463 Chapter 16 Monitoring the vSphere Environment 501 Chapter 17 Auditing the vSphere Environment 529 Part V Scripting Tools and Features 561 Chapter 18 Scheduling Automation Scripts 563 Chapter 19 The SDK 583 Chapter 20 The Onyx Project 621 Chapter 21 PowerGUI and vEcoShell 635 Chapter 22 PowerWF Studio 663 Chapter 23 Add a GUI Front-End to Your Automation Scripts 687 Index 715 Table of Contents Forewords xix Introduction xxi Part I Install, Configure, and Manage the vSphere Environment 1 Chapter 1 Automating vCenter Server Deployment and Configuration 3 Prepare the vCenter Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Create an Automated Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Set Up Your vCenter Folder Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Creating a Folder Structure from Scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Exporting a Folder Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Importing a Folder Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Define Users and Their Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Granting Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Creating New Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Bringing in Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Exporting Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Importing Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Configure Datacenters and Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Creating Datacenters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Creating Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Configuring High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Configuring Distributed Resource Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Configuring Enhanced vMotion Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Configuring Distributed Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Viewing License Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Licensing a Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Chapter 2 Automating vSphere Hypervisor Deployment and Configuration 35 Prepare for an Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Installation Medium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gathering Required Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Automate an Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Customizing an Installation with Kickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Postinstallation Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 36 37 37 38 43 Chapter 3 Automating Storage and Networking 67 Set Up the Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Setting Up Different Types of Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Configuring an iSCSI Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 xii Contents Rescanning for New Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Datastores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting a Multipath Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Set Up the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Standard and Distributed Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding VMkernel Port Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Making Your Switches and Port Groups Resilient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copying Networking Configuration from Another Host . . . . . . . . . . . . . . . . . . . . . . . . . . Moving Multiple VMs to a New Port Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 70 77 78 78 83 84 86 89 Chapter 4 Using Advanced vSphere Features 93 Manage vNetwork Distributed Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Use Fault Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Configure Storage I/O Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Use Distributed Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Configure Host Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Configure Active Directory Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Part II Managing the Virtual Machine Life Cycle 127 Chapter 5 Creating Virtual Machines 129 Use the New-VM Cmdlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a New Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cloning a Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying from a Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Registering a Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use the SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Perform a Mass Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preparing for Mass Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Running the Deployment Synchronous or Asynchronous . . . . . . . . . . . . . . . . . . . . . . . Postconfiguration and Validating the New Virtual Machines . . . . . . . . . . . . . . . . . . . . . Identify Eye-Catchers for Auditing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Custom Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maintaining Custom Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maintain VMware Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Windows Silent Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Linux Silent Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Updating VMware Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 131 136 137 139 143 150 151 152 154 157 157 159 163 164 165 170 Chapter 6 Using Templates and Customization Specifications 173 Use Customization Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating Customization Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Managing Customization Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Customization Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 174 175 177 Contents Use Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Guests from Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maintaining Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 7 Configuring Virtual Machine Hardware 197 Add, Configure, and Remove Virtual Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing Memory Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing the Number of vCPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing vCPU Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding or Removing a Network Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Assigning a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a Virtual Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Removing a Virtual Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extending a Virtual Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing Other Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optimize Storage Usage with Thin Provisioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Converting a Virtual Disk Using Storage vMotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Converting a Virtual Disk in Place . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 198 199 201 203 205 207 208 211 218 221 223 224 224 Chapter 8 Advanced Virtual Machine Features 229 Interact with the Guest OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Linux Native Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Windows Native Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using PowerCLI Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use vMotion and Storage vMotion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examining vMotion Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Moving a Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use and Manage Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating and Removing Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maintaining Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Restricting the Creation of Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 178 179 185 230 231 235 245 250 250 251 256 257 258 264 Chapter 9 Using vApps 269 Import Virtual Appliances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create Your Own vApps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maintain vApps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting the Start Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using IP Pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using IP Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modifying vApp Product Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 272 274 274 282 293 296 xiii