Luc Dekens
VMware vSphere
VMware vSphere® Power CLI™ Reference
Second Edition
Luc Dekens
Jonathan Medd
Brian Graf
Glenn Sizemore
Andrew Sullivan
Matt Boren
Copyright
Copyright © 2016 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-92511-9
ISBN: 978-1-118-82513-3 (ebk.)
ISBN: 978-1-118-92514-0 (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) 750-8400, 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 publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2015958016
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 and PowerCLI are trademarks or registered trademarks of VMware, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
10 9 8 7 6 5 4 3 2 1
Credits
Senior Acquisitions Editor: Stephanie McComb
Development Editor: ME Schutz
Technical Editor: Matt Boren
Production Editor: Christine O’Connor
Copy Editor: Elizabeth Welch
Editorial Manager: Mary Beth Wakefield
Production Manager: Kathleen Wisor
Associate Publisher: Jim Minatel
Book Design and Composition: Maureen Forys, Happenstance Type-O-Rama
Proofreader: Amy Schneider
Indexer: Nancy Guenther
Project Coordinator, Cover: Brent Savage
Cover Designer: Wiley
Cover Image: Getty Images/Thomas Northcut
Dedication
To Mom and Dad: I can do this because of you – thank you! – Matt
To my family, friends, and colleagues: This took quite a bit of our time away. – Luc
For Ellen, my wife, my inspiration, and my best friend – Brian
To my family, thanks for waiting for me to complete this during all those evenings when there were far more interesting things for us to do. I’m back now – Jonathan
To my family, for letting me do another one of these – Glenn
To my children, you motivate me to be the person you believe I am – Andrew
Acknowledgments
Thanks to the other authors on this book for making this book, and for being open to (most of) the feedback from the technical editor (feedback given in efforts to make functionality and features even better). And thank you, Gentle Editor, development editor Mary Ellen Schutz, for the guidance and wrangling throughout. LucD, thank you for what you do for the community, and for bringing me in on this project. Thank you, Jeffrey Snover, for risking life, limb, and career to make the great changes at Microsoft that then brought PowerShell, and a new attitude, to the world. Thanks also to the Microsofties responsible for PowerShell, and to those from VMware who have made PowerCLI a great product. And, to my wife, thank you much for tolerating the hours and days of me, locked in the office, poring over the manuscript and code – IHLY.
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,” development editor Mary Ellen Schutz. 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!
I’d like to thank my wife, Ellen, the love of my life, for patiently supporting me in my ambitions and endeavors, and my children, who bring me such happiness and joy. I would like to thank my parents for their kindness and love and for enabling me to reach my potential.
I’d like to thank Chad Hancock for igniting my desire to learn and grow because of his passion for teaching and empowering his students. I’d also like to thank the other authors for believing in me and allowing me this opportunity to write with them.
Thanks to the other authors for their contributions, especially for helping answer some of