Learning PowerCLI - Second Edition

Learn to leverage the power of PowerCLI to automate your VMware vSphere environment with ease
Preview in Mapt

Learning PowerCLI - Second Edition

Robert van den Nieuwendijk

Learn to leverage the power of PowerCLI to automate your VMware vSphere environment with ease
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning PowerCLI - Second Edition Book Cover
Learning PowerCLI - Second Edition
$ 39.99
$ 28.00
Learning PowerCLI Book Cover
Learning PowerCLI
$ 26.99
$ 18.90
Buy 2 for $35.00
Save $31.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781786468017
Paperback562 pages

Book Description

VMware vSphere PowerCLI, a free extension to Microsoft Windows PowerShell, enables you to automate the management of a VMware vSphere or vCloud environment.

This book will show you how to automate your tasks and make your job easier. Starting with an introduction to the basics of PowerCLI, the book will teach you how to manage your vSphere and vCloud infrastructure from the command line. To help you manage a vSphere host overall, you will learn how to manage vSphere ESXi hosts, host profiles, host services, host firewall, and deploy and upgrade ESXi hosts using Image Builder and Auto Deploy. The next chapter will not only teach you how to create datastore and datastore clusters, but you’ll also work with profile-driven and policy-based storage to manage your storage. To create a disaster recovery solution and retrieve information from vRealize Operations, you will learn how to use Site Recovery Manager and vRealize Operations respectively. Towards the end, you’ll see how to use the REST APIs from PowerShell to manage NSX and vRealize Automation and create patch baselines, scan hosts against the baselines for missing patches, and re-mediate hosts.

By the end of the book, you will be capable of using the best tool to automate the management and configuration of VMware vSphere.

Table of Contents

Chapter 1: Introduction to PowerCLI
Downloading and installing PowerCLI
Participating in the VMware Customer Improvement Program
Modifying the PowerShell execution policy
Creating a PowerShell profile
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 hosts to a VMware vCenter Server
Enabling and disabling maintenance mode
Working with host profiles
Working with host services
Configuring the host firewall
Using vSphere Image Builder and Auto Deploy
Using esxcli from PowerCLI
Removing hosts from a VMware vCenter Server
Summary
Chapter 5: Managing Virtual Machines with PowerCLI
Creating virtual machines
Registering virtual machines
Using OS customization specifications
Importing OVF or OVA packages
Starting and stopping virtual machines
Modifying the settings of virtual machines
Converting virtual machines into templates
Moving virtual machines to another folder, host, cluster, resource pool, or datastore
Updating VMware Tools
Upgrading virtual machine compatibility
Using snapshots
Running commands in the guest OS
Configuring Fault Tolerance
Opening the console of virtual machines
Removing virtual machines
Using tags
Summary
Chapter 6: Managing Virtual Networks with PowerCLI
Using vSphere Standard Switches
Using host network adapters
Using standard port groups
Using vSphere Distributed Switches
Using distributed virtual port groups
Configuring host networking
Configuring the network of virtual machines
Summary
Chapter 7: Managing Storage
Rescanning for new storage devices
Creating datastores
Retrieving datastores
Setting the multipathing policy
Configuring vmhba paths to an SCSI device
Working with Raw Device Mappings
Configuring storage I/O control
Configuring Storage DRS
Upgrading datastores to VMFS-5
Removing datastores
Using VMware vSAN
Using vSphere storage policy-based management
Summary
Chapter 8: Managing High Availability and Clustering
Creating vSphere HA and DRS clusters
Retrieving clusters
Modifying the cluster settings
Moving hosts to clusters
Moving clusters
Using DRS rules
Using DRS recommendations
Using resource pools
Using Distributed Power Management
Removing clusters
Summary
Chapter 9: Managing vCenter Server
Working with roles and permissions
Managing licenses
Configuring alarms
Retrieving events
Summary
Chapter 10: Patching ESXi Hosts and Upgrading Virtual Machines
Downloading new patches into the Update Manager repository
Retrieving patches in the Update Manager repository
Using baselines and baseline groups
Testing inventory objects for compliance with baselines
Retrieving baseline compliance data
Initializing staging of patches
Remediating inventory objects
Summary
Chapter 11: Managing VMware vCloud Director and vCloud Air
Connecting to vCloud Air servers and vCloud Director servers
Retrieving organizations
Retrieving organization virtual datacenters
Retrieving organization networks
Retrieving vCloud users
Using vCloud virtual appliances
Managing vCloud virtual machines
Using the vCloud Director API with Get-CIView
Disconnecting from vCloud Director servers
Summary
Chapter 12: Using Site Recovery Manager
Installing SRM
Connecting to SRM servers
Downloading and installing the Meadowcroft.SRM module
Pairing SRM sites
Retrieving the SRM user info
Managing protection groups
Protecting virtual machines
Retrieving protected virtual machines
Unprotecting virtual machines
Managing recovery plans
Disconnecting from SRM servers
Summary
Chapter 13: Using vRealize Operations Manager
Connecting to vRealize Operations Manager servers
Retrieving vRealize Operations Manager resource objects
Using alerts
Retrieving recommendations
Retrieving statistic keys
Retrieving statistical data
Retrieving local user accounts
Using the vRealize Operations Manager API
Disconnecting from vRealize Operations Manager servers
Summary
Chapter 14: Using REST API to manage NSX and vRealize Automation
Connecting to REST API servers
Managing NSX logical switches
Managing NSX logical (distributed) routers
Managing NSX Edge services gateways
Connecting to vRA servers
Managing vRA tenants
Retrieving vRA business groups
Managing vRA reservations
Managing vRA machines and applications
Summary
Chapter 15: 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
Summary

What You Will Learn

  • Explore PowerShell and PowerCLI cmdlets and their output objects
  • See how to manage virtual machines and work with virtual networks
  • Manage vCloud Director from PowerCLI
  • Use Site Recovery Manager from PowerCLI to create a disaster recovery solution
  • Manage NSX and vRealize Automation using REST API with PowerCLI
  • Create and configure vSphere HA and DRS clusters
  • Use vSphere Update Manager with PowerCLI to create patch baselines and scan hosts
  • Explore reporting techniques to retrieve log files

Authors

Table of Contents

Chapter 1: Introduction to PowerCLI
Downloading and installing PowerCLI
Participating in the VMware Customer Improvement Program
Modifying the PowerShell execution policy
Creating a PowerShell profile
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 hosts to a VMware vCenter Server
Enabling and disabling maintenance mode
Working with host profiles
Working with host services
Configuring the host firewall
Using vSphere Image Builder and Auto Deploy
Using esxcli from PowerCLI
Removing hosts from a VMware vCenter Server
Summary
Chapter 5: Managing Virtual Machines with PowerCLI
Creating virtual machines
Registering virtual machines
Using OS customization specifications
Importing OVF or OVA packages
Starting and stopping virtual machines
Modifying the settings of virtual machines
Converting virtual machines into templates
Moving virtual machines to another folder, host, cluster, resource pool, or datastore
Updating VMware Tools
Upgrading virtual machine compatibility
Using snapshots
Running commands in the guest OS
Configuring Fault Tolerance
Opening the console of virtual machines
Removing virtual machines
Using tags
Summary
Chapter 6: Managing Virtual Networks with PowerCLI
Using vSphere Standard Switches
Using host network adapters
Using standard port groups
Using vSphere Distributed Switches
Using distributed virtual port groups
Configuring host networking
Configuring the network of virtual machines
Summary
Chapter 7: Managing Storage
Rescanning for new storage devices
Creating datastores
Retrieving datastores
Setting the multipathing policy
Configuring vmhba paths to an SCSI device
Working with Raw Device Mappings
Configuring storage I/O control
Configuring Storage DRS
Upgrading datastores to VMFS-5
Removing datastores
Using VMware vSAN
Using vSphere storage policy-based management
Summary
Chapter 8: Managing High Availability and Clustering
Creating vSphere HA and DRS clusters
Retrieving clusters
Modifying the cluster settings
Moving hosts to clusters
Moving clusters
Using DRS rules
Using DRS recommendations
Using resource pools
Using Distributed Power Management
Removing clusters
Summary
Chapter 9: Managing vCenter Server
Working with roles and permissions
Managing licenses
Configuring alarms
Retrieving events
Summary
Chapter 10: Patching ESXi Hosts and Upgrading Virtual Machines
Downloading new patches into the Update Manager repository
Retrieving patches in the Update Manager repository
Using baselines and baseline groups
Testing inventory objects for compliance with baselines
Retrieving baseline compliance data
Initializing staging of patches
Remediating inventory objects
Summary
Chapter 11: Managing VMware vCloud Director and vCloud Air
Connecting to vCloud Air servers and vCloud Director servers
Retrieving organizations
Retrieving organization virtual datacenters
Retrieving organization networks
Retrieving vCloud users
Using vCloud virtual appliances
Managing vCloud virtual machines
Using the vCloud Director API with Get-CIView
Disconnecting from vCloud Director servers
Summary
Chapter 12: Using Site Recovery Manager
Installing SRM
Connecting to SRM servers
Downloading and installing the Meadowcroft.SRM module
Pairing SRM sites
Retrieving the SRM user info
Managing protection groups
Protecting virtual machines
Retrieving protected virtual machines
Unprotecting virtual machines
Managing recovery plans
Disconnecting from SRM servers
Summary
Chapter 13: Using vRealize Operations Manager
Connecting to vRealize Operations Manager servers
Retrieving vRealize Operations Manager resource objects
Using alerts
Retrieving recommendations
Retrieving statistic keys
Retrieving statistical data
Retrieving local user accounts
Using the vRealize Operations Manager API
Disconnecting from vRealize Operations Manager servers
Summary
Chapter 14: Using REST API to manage NSX and vRealize Automation
Connecting to REST API servers
Managing NSX logical switches
Managing NSX logical (distributed) routers
Managing NSX Edge services gateways
Connecting to vRA servers
Managing vRA tenants
Retrieving vRA business groups
Managing vRA reservations
Managing vRA machines and applications
Summary
Chapter 15: 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
Summary

Book Details

ISBN 139781786468017
Paperback562 pages
Read More

Read More Reviews

Recommended for You

Learning VMware NSX Book Cover
Learning VMware NSX
$ 31.99
$ 22.40
Troubleshooting vSphere Storage Book Cover
Troubleshooting vSphere Storage
$ 23.99
$ 16.80
Learning PowerCLI Book Cover
Learning PowerCLI
$ 26.99
$ 18.90
PowerCLI Cookbook Book Cover
PowerCLI Cookbook
$ 39.99
$ 28.00
Mastering PowerCLI Book Cover
Mastering PowerCLI
$ 43.99
$ 30.80
VMware vSphere 6.x Datacenter Design Cookbook - Second Edition Book Cover
VMware vSphere 6.x Datacenter Design Cookbook - Second Edition
$ 47.99
$ 33.60