Book description
Over 75 step-by-step recipes to put PowerCLI into action for efficient administration of your virtual environment
In Detail
PowerCLI allows faster administration by executing tasks on groups of objects in the virtual environment and is flexible enough to allow complex, scripted routines to solve complex problems.
PowerCLI Cookbook illustrates the ease of performing repetitive tasks using native PowerCLI commands to speed up administration. This book teaches you how to create custom functions and modules to solve specific problems and deploy these solutions to operators. It covers all vSphere administration areas including host, cluster, and virtual machine management utilizing PowerCLI.
Finally, this book will enable administrators to execute scripts that will open new possibilities for automation and also enable them to manage VM workloads effectively.
What You Will Learn
- Configure and administer VMware ESXi hosts, clusters, and vCenter
- Manage virtual machine configurations and operations
- Administer datastores, datastore clusters, and virtual machine snapshots
- Create and configure virtual networking in a vSphere environment
- Manage cluster features and affinity groups
- Make custom reports and notifications from vSphere
- Direct operations in vCloud Director
Table of contents
-
PowerCLI Cookbook
- Table of Contents
- PowerCLI Cookbook
- Credits
- About the Author
- Acknowledgments
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Configuring the Basic Settings of an ESXi Host with PowerCLI
- Introduction
- Connecting to an ESXi host or a vCenter instance
- Getting the VMware host object
- Joining an ESXi host into Active Directory
- Enabling services and setting security profiles
- Setting network configuration
- Creating datastores on an ESXi host
- Configuring syslog settings on an ESXi host
- Joining an ESXi host to vCenter
- Creating a configuration script to set all properties uniformly
- 2. Configuring vCenter and Computing Clusters
-
3. Managing Virtual Machines
- Introduction
- Deploying the first virtual machine
- Cloning a virtual machine to a template
- Deploying new virtual machines from a template
- Importing a virtual appliance from OVA
- Performing a hot add of virtual hardware to an existing virtual machine
- Enabling and disabling Fault Tolerance on a virtual machine
- Increasing the disk space in a virtual machine
- Upgrading the virtual hardware version of a virtual machine
- Locating and reloading inaccessible or invalid virtual machines
- Setting VMware Tool settings from PowerCLI
- Creating basic reports of VM properties using VMware Tools and PowerCLI
-
4. Working with Datastores and Datastore Clusters
- Introduction
- Performing Storage vMotion
- Finding Raw Disk Mappings in your environment
- Locating thin or thick provisioned disks
- Converting thin to thick disks with Storage vMotion
- Creating and managing datastore clusters
- Setting Storage DRS automation levels for individual virtual machines
- Setting Storage DRS automation levels for individual VMs using PowerCLI 6
-
5. Creating and Managing Snapshots
- Introduction
- Creating a snapshot
- Getting a list of snapshots in the environment
- Manipulating the list of snapshots to get better information
- Scoping and filtering a list of snapshots
- Removing targeted snapshots
- Find lost or unknown snapshots
- Creating a function to automatically remediate snapshots
- Scheduling automatic snapshot remediation
- Creating a snapshot management module
-
6. Managing Resource Pools, Reservations, and Limits for Virtual Machines
- Introduction
- Setting reservations and limits for resource pools
- Balancing share allocations on resource pools
- Creating a custom attribute with a number of shares per VM on each resource pool
- Automating share allocation balancing
- Reporting shares, reservations, and limits of resource pools and virtual machines
-
7. Creating Custom Reports and Notifications for vSphere
- Introduction
- Getting alerts from a vSphere environment
- Basics of formatting output from PowerShell objects
- Sending output to CSV and HTML
- Reporting VM objects created during a predefined time period from VI Events object
- Setting custom properties to add useful context to your virtual machines
- Using PowerShell native capabilities to schedule scripts
-
8. Performing ESXCLI and in-guest Commands from PowerCLI
- Introduction
- Retrieving the ESXCLI object in PowerCLI
- Using the ESXCLI vm namespace to kill a misbehaving VM
- Performing ESXi ping with an ESXCLI object
- Configuring custom storage and path selection policies
- Configuring coredump settings for an ESXi host from PowerCLI
- Executing native commands inside the guest operating system from PowerCLI
-
9. Managing DRS and Affinity Groups using PowerCLI
- Introduction
- Applying recommendations for partially automated DRS clusters
- Setting a cluster into maintenance mode with PowerCLI
- Using native DRS rule cmdlets to manage KeepTogether and Separate rules
- Learning the MoRef way of identifying objects
- Creating a DRS group for virtual machines
- Listing the members of a DRS group
- Updating the members of a VM DRS group
- Creating a custom function to update members of a DRS group
- Creating rules to maintain memberships of DRS groups using a custom function
- Using Compare-Object to audit group memberships for differences
-
10. Working with vCloud Director from PowerCLI
- Introduction
- Connecting to a vCloud environment
- Creating and managing organizations in vCloud
- Creating a new user in an organization using Views
- Creating an organization's virtual datacenter in vCloud Director
- Importing a vApp template into vCloud
- Configuring networking in a vCloud vApp
- Reassigning vApp VM network settings with PowerCLI
- Starting and stopping vApps and individual VMs in a vCloud
- A. Setting up and Configuring vCloud Director
- Index
Product information
- Title: PowerCLI Cookbook
- Author(s):
- Release date: March 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784393724
You might also like
video
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
BeagleBone is an inexpensive web server, Linux desktop, and electronics hub that includes all the tools …
video
OpenTSDB
OpenTSDB is an open-source, distributed time series database designed to monitor large clusters of commodity machines …
book
PowerCLI Essentials
Simplify and automate server administration tasks with PowerCLI About This Book Automate VMware’s VSphere environment by …
book
Learning PowerCLI
Automate your Vmware vSphere environment by learning how to install and use PowerCLI. This book takes …