VMware PowerCLI is one of the most utilized command-line interfaces for a VMware vSphere System Administrator. Covering more than 480 different functions of a vSphere system, PowerCLI and PowerShell have become one of the staples of an automation enabler in this space. Taking the viewpoint of an administrator with some experience, Essential VMware Administration with PowerCLI introduces the idea and concept of taking the beginning steps toward developing one-line commands into multi-line scripts that can be used not only by the reader but also by others within their organization.
This book is designed with the mindset of think first, design second, script next, and test last. It covers getting the tool and integrating it with other products in the VMware stack and attempts to build on the knowledge outlined from the chapter before.
Chapter 1, An Introduction to Essential Administration with PowerCLI, sets the stage through discussing how to get PowerCLI, what the difference is between PowerShell and PowerCLI, discusses its version history, and provides a starting point with its installation. This chapter is a means to get you up and running with the right version and the best tools for the job.
Chapter 2, Comparing Point and Click Administration to PowerCLI and Scripting, looks through the eye of an administrator, helping to redefine the typical point and click doldrums and compare them to the exciting and provocative world of scripting.
Chapter 3, Enhancing the Scripting Experience, takes the previous chapter and builds upon it. This chapter will enhance the experience through better practices, help a team build a repository, and make the code reusable.
Chapter 4, Windows Administration within VMware Administration, starts with the preparation of a DevOps practice and the roles around it. This programmatically helps bridge the gap for becoming operationally transformed and influences how an organization can build a private cloud type of environment. We will use this mindset to build and provision a Windows script host, and run PowerCLI and Windows-based PowerShell in the same script.
Chapter 5, Workflows and vRealize Orchestrator, introduces the vRealize Orchestrator product, how workflows are developed, and where to use them. The chapter will provide a walkthrough of the installation of vRealize Orchestrator and where it fits in the environment.
Chapter 6, Running Workflows with Other VMware Products, discusses other VMware products such as NSX, Orchestrator, vRealize Operations Manager, Site Recovery Manager, and VSAN. It takes each technology and product, explains the product, where it fits, and then, finally, how PowerCLI can integrate with them.
This book depends upon you, the reader, to have a vSphere environment to connect to and run the scripts against. This can be achieved through a try and buy download from VMware.com or with a company Test environment. A vSphere environment typically includes:
A VMware vCenter server utilizing a Windows-based standalone installation or a vCenter Server Appliance
An attached VMware ESXi server
This book was written using PowerShell v3 on Windows Server 2008 R2 VM or on PowerShell v4 running on Windows Server 2012 R2 VM. The scripts were tested on multiple systems for compatibility and to reduce errata in the scripts. PowerCLI version 6.0 R1 and R2 were used.
PowerCLI Essentials is focused toward virtualization professionals and system administrators who want to discover and learn about the automation techniques associated with PowerCLI for complex virtual environments.
In this book, you will find a number of text styles 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: "The Get-PowerCLIConfiguration
command will show three scopes of the configuration, Session
, User
, and AllUsers
."
Any command-line input or output is written as follows:
$PSVersionTable.PSVersion.Major
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Set Screen Buffer Size for Width and Height whenever possible."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>
, and mention the book's title in 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 at www.packtpub.com/authors.
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.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.
You can download the code files by following these steps:
Log in or register to our website using your e-mail address and password.
Hover the mouse pointer on the SUPPORT tab at the top.
Click on Code Downloads & Errata.
Enter the name of the book in the Search box.
Select the book for which you're looking to download the code files.
Choose from the drop-down menu where you purchased this book from.
Click on Code Download.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
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 could 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 to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted 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 <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>
, and we will do our best to address the problem.