Learning PowerCLI

Automate your Vmware vSphere environment by learning how to install and use PowerCLI. This book takes a practical tutorial approach that will have you automating your daily routine tasks in no time.

Learning PowerCLI

Learning
Robert van den Nieuwendijk

Automate your Vmware vSphere environment by learning how to install and use PowerCLI. This book takes a practical tutorial approach that will have you automating your daily routine tasks in no time.
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781782170167
Paperback374 pages

About This Book

  • Automate your VMware vSphere environment including hosts, clusters, storage, and vCenter Server virtual machines and networks
  • Create good-looking, clean reports in no time, increasing your efficiency
  • Get to grips with PowerCLI to automate routine tasks using practical examples

Who This Book Is For

This book is ideal for you if you want to learn how to automate your VMware vSphere infrastructure, by getting the most out of PowerCLI. It’s assumed that you have some experience in administrating a VMware vSphere environment. Knowledge of Microsoft’s Windows PowerShell is not a prerequisite.

Table of Contents

Chapter 1: Introduction to PowerCLI
Downloading and installing PowerCLI
Modifying the PowerShell execution policy
Connecting and disconnecting servers
Using the credential store
Retrieving a list of all of your virtual machines
Retrieving a list of all of your hosts
Summary
Chapter 2: Learning Basic PowerCLI Concepts
Using the Get-Command, Get-Help, and Get-Member cmdlets
Using providers and PSDrives
Using arrays and hash tables
Creating calculated properties
Using raw API objects with ExtensionData or Get-View
Extending PowerCLI objects with the New-VIProperty cmdlet
Working with vSphere folders
Summary
Chapter 3: Working with Objects in PowerShell
Using objects, properties, and methods
Expanding variables and subexpressions in strings
Using here-strings
Using the pipeline
Using the PowerShell object cmdlets
Creating your own objects
Using COM objects
Summary
Chapter 4: Managing vSphere Hosts with PowerCLI
Adding a host to a VMware vCenter Server
Enabling and disabling maintenance mode
Working with host profiles
Working with host services
Configuring the host firewall
Configuring vSphere Image Builder and Auto Deploy
Using esxcli from PowerCLI
Using the vSphere CLI commands from PowerCLI
Removing a host from the VMware vCenter Server
Summary
Chapter 5: Managing Virtual Machines with PowerCLI
Creating a virtual machine
Registering a virtual machine
Using OS customization specifications
Starting and stopping a virtual machine
Modifying the settings of a virtual machine
Converting a virtual machine into a template
Moving a virtual machine to another folder, host, cluster, resource pool, or datastore
Updating the VMware Tools
Upgrading virtual machine compatibility
Using snapshots
Running commands on the guest OS
Configuring Fault Tolerance
Opening the console of a virtual machine
Removing a virtual machine
Summary
Chapter 6: Managing Virtual Networks with PowerCLI
Using vSphere Standard Switches
Using host network adapters
Using standard port groups
Using vSphere Distributed Switches
Removing vSphere Distributed Switches
Using distributed virtual port groups
Configuring host networking
Configuring the network of a virtual machine
Summary
Chapter 7: Managing Storage with PowerCLI
Rescanning for new storage devices
Creating datastores
Retrieving datastores
Setting the multipathing policy
Configuring the vmhba paths to a SCSI device
Working with Raw Device Mappings
Configuring Storage I/O Control
Configuring Storage DRS
Upgrading datastores to VMFS-5
Removing datastores
Summary
Chapter 8: Managing High Availability and Clustering with PowerCLI
Creating vSphere HA and DRS clusters
Retrieving clusters
Modifying cluster settings
Moving hosts to clusters
Moving clusters
Using DRS rules
Using DRS recommendations
Using resource pools
Using Distributed Power Management (DPM)
Removing clusters
Summary
Chapter 9: Managing vCenter with PowerCLI
Working with roles and permissions
Managing licenses
Configuring alarms
Retrieving events
Summary
Chapter 10: Reporting with PowerCLI
Retrieving log files
Creating log bundles
Performance reporting
Exporting reports to CSV files
Generating HTML reports
Sending reports by e-mail
Reporting the health of your vSphere environment with vCheck
Using PowerGUI
Summary

What You Will Learn

  • Download and install PowerCLI
  • Add hosts to VMware vCenter Server
  • Configure vSphere Auto Deploy
  • Use the esxcli command from PowerCLI
  • Create OS Customization Specs
  • Monitor virtual machine performance
  • Configure distributed virtual switches and storage I/O Control
  • Enable VM and Application Monitoring
  • Manage licenses for multiple hosts to migrate them easily
  • Configure an alarm to monitor your networks virtual machines
  • Generate a good-looking HTML report in no time

In Detail

VMware vSphere PowerCLI is a powerful command-line tool to automate all aspects of a VMware vSphere environment. PowerCLI is built on top of the popular Windows PowerShell, with which you can automate server tasks and reduce manual input, allowing you to focus on more important tasks.

"Learning PowerCLI" is a practical, hands-on guide that provides you with a thorough knowledge of VMware vSphere PowerCLI. This knowledge will help you to automate your routine tasks so you can save valuable time.

"Learning PowerCLI" introduces you to VMware vSphere PowerCLI, from downloading and installing the software to creating good-looking reports of your VMware vSphere environment.

You will learn about working with host profiles, configuring virtual switches, removing snapshots, configuring Storage DRS, working with affinity rules, configuring an alarm, and managing roles and permissions. You will learn everything you need to know to get started with automating your VMware vSphere infrastructure. All the examples in Learning PowerCLI can be used directly in your environment.

Authors

Table of Contents

Chapter 1: Introduction to PowerCLI
Downloading and installing PowerCLI
Modifying the PowerShell execution policy
Connecting and disconnecting servers
Using the credential store
Retrieving a list of all of your virtual machines
Retrieving a list of all of your hosts
Summary
Chapter 2: Learning Basic PowerCLI Concepts
Using the Get-Command, Get-Help, and Get-Member cmdlets
Using providers and PSDrives
Using arrays and hash tables
Creating calculated properties
Using raw API objects with ExtensionData or Get-View
Extending PowerCLI objects with the New-VIProperty cmdlet
Working with vSphere folders
Summary
Chapter 3: Working with Objects in PowerShell
Using objects, properties, and methods
Expanding variables and subexpressions in strings
Using here-strings
Using the pipeline
Using the PowerShell object cmdlets
Creating your own objects
Using COM objects
Summary
Chapter 4: Managing vSphere Hosts with PowerCLI
Adding a host to a VMware vCenter Server
Enabling and disabling maintenance mode
Working with host profiles
Working with host services
Configuring the host firewall
Configuring vSphere Image Builder and Auto Deploy
Using esxcli from PowerCLI
Using the vSphere CLI commands from PowerCLI
Removing a host from the VMware vCenter Server
Summary
Chapter 5: Managing Virtual Machines with PowerCLI
Creating a virtual machine
Registering a virtual machine
Using OS customization specifications
Starting and stopping a virtual machine
Modifying the settings of a virtual machine
Converting a virtual machine into a template
Moving a virtual machine to another folder, host, cluster, resource pool, or datastore
Updating the VMware Tools
Upgrading virtual machine compatibility
Using snapshots
Running commands on the guest OS
Configuring Fault Tolerance
Opening the console of a virtual machine
Removing a virtual machine
Summary
Chapter 6: Managing Virtual Networks with PowerCLI
Using vSphere Standard Switches
Using host network adapters
Using standard port groups
Using vSphere Distributed Switches
Removing vSphere Distributed Switches
Using distributed virtual port groups
Configuring host networking
Configuring the network of a virtual machine
Summary
Chapter 7: Managing Storage with PowerCLI
Rescanning for new storage devices
Creating datastores
Retrieving datastores
Setting the multipathing policy
Configuring the vmhba paths to a SCSI device
Working with Raw Device Mappings
Configuring Storage I/O Control
Configuring Storage DRS
Upgrading datastores to VMFS-5
Removing datastores
Summary
Chapter 8: Managing High Availability and Clustering with PowerCLI
Creating vSphere HA and DRS clusters
Retrieving clusters
Modifying cluster settings
Moving hosts to clusters
Moving clusters
Using DRS rules
Using DRS recommendations
Using resource pools
Using Distributed Power Management (DPM)
Removing clusters
Summary
Chapter 9: Managing vCenter with PowerCLI
Working with roles and permissions
Managing licenses
Configuring alarms
Retrieving events
Summary
Chapter 10: Reporting with PowerCLI
Retrieving log files
Creating log bundles
Performance reporting
Exporting reports to CSV files
Generating HTML reports
Sending reports by e-mail
Reporting the health of your vSphere environment with vCheck
Using PowerGUI
Summary

Book Details

ISBN 139781782170167
Paperback374 pages
Read More