售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning PowerCLI Second Edition
Learning PowerCLI Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to PowerCLI
Downloading and installing PowerCLI
Requirements for using PowerCLI 6.5 Release 1
Downloading PowerCLI 6.5 Release 1
Installing PowerCLI
Participating in the VMware Customer Improvement Program
Modifying the PowerShell execution policy
Creating a PowerShell profile
Connecting and disconnecting servers
Connecting to a server
Connecting to multiple servers
Suppressing certificate warnings
Disconnecting from a server
Retrieving the PowerCLI configuration
Using the credential store
Retrieving a list of all of your virtual machines
Suppressing deprecated warnings
Using wildcard characters
Filtering objects
Using comparison operators
Using aliases
Retrieving a list of all of your hosts
Displaying the output in a grid view
Summary
2. Learning Basic PowerCLI Concepts
Using the Get-Command, Get-Help, and Get-Member cmdlets
Using Get-Command
Using Get-VICommand
Using Get-Help
Using Get-PowerCLIHelp
Using Get-PowerCLICommunity
Using Get-Member
Using providers and PSDrives
Using providers
Using PSDrives
Using the PowerCLI Inventory Provider
Using the PowerCLI Datastore Provider
Copying files between a datastore and your PC
Using arrays and hash tables
Creating calculated properties
Using raw API objects with ExtensionData or Get-View
Using the ExtensionData property
Using the Get-View cmdlet
Using managed object references
Using the Get-VIObjectByVIView cmdlet
Extending PowerCLI objects with the New-VIProperty cmdlet
Working with vSphere folders
Summary
3. Working with Objects in PowerShell
Using objects, properties, and methods
Using methods
Expanding variables and subexpressions in strings
When will a string be expanded?
Expanding a string when it is used
Using here-strings
Using the pipeline
Using the ByValue parameter binding
Using the ByPropertyName parameter binding
Using the PowerShell object cmdlets
Using the Select-Object cmdlet
Using the Where-Object cmdlet
Using the ForEach-Object cmdlet
Using the Sort-Object cmdlet
Using the Measure-Object cmdlet
Rounding a value
Using the Group-Object cmdlet
Using the Compare-Object cmdlet
Using the Tee-Object cmdlet
Creating your own objects
Using the New-Object cmdlet
Using a hash table to create an object
Creating objects using the Select-Object cmdlet
Creating objects using [pscustomobject]
Adding properties to an object with Add-Member
Using COM objects
Summary
4. Managing vSphere Hosts with PowerCLI
Adding hosts to a VMware vCenter Server
Creating a data center
Creating a cluster
Adding a host
Enabling and disabling maintenance mode
Working with host profiles
Creating a host profile
Attaching the host profile to a cluster or a host
Testing the host profile for compliance
Applying a host profile to a host or cluster
Using host profile answer files
Exporting a host profile
Importing a host profile
Working with host services
Retrieving information about host services
Starting a host service
Stopping a host service
Restarting a host service
Modifying the startup policy of a host service
Configuring the host firewall
Getting the host firewall default policy
Modifying the host firewall default policy
Getting the host firewall exceptions
Modifying a host firewall exception
Using vSphere Image Builder and Auto Deploy
Using Image Builder
Adding ESXi software depots to your PowerCLI session
Retrieving the ESXi software depots added to your PowerCLI session
Retrieving the image profiles in your PowerCLI session
Creating image profiles
Retrieving VIB objects from all of the connected depots
Adding VIBs to an image profile or updating existing VIBs
Exporting an image profile to an ISO or ZIP file
Configuring Auto Deploy
Creating deploy rules
Adding deploy rules to a ruleset
Retrieving deploy rulesets
Adding host profiles to a deploy ruleset
Using esxcli from PowerCLI
Removing hosts from a VMware vCenter Server
Summary
5. Managing Virtual Machines with PowerCLI
Creating virtual machines
Creating virtual machines from scratch
Creating virtual machines from templates
Cloning virtual machines
Registering virtual machines
Using OS customization specifications
Importing OVF or OVA packages
Retrieving the required properties
Assigning values to the required properties
Importing the vMA OVF file
Starting and stopping virtual machines
Starting virtual machines
Suspending virtual machines
Shutting down the virtual machine's guest operating systems
Stopping virtual machines
Modifying the settings of virtual machines
Using the VMware vSphere API to modify virtual machine settings
Adding devices to a virtual machine
Adding a hard disk
Adding a SCSI controller
Adding a network adapter
Adding a floppy drive
Adding a CD drive
Modifying devices added to a virtual machine
Modifying a hard disk
Moving a hard disk to another datastore
Modifying a SCSI controller
Modifying a network adapter
Modifying a floppy drive
Modifying a CD drive
Removing devices from a virtual machine
Removing a hard disk
Removing a network adapter
Removing a floppy drive
Removing a CD drive
Converting virtual machines into templates
Converting templates into virtual machines
Modifying the name of a template
Removing templates
Moving virtual machines to another folder, host, cluster, resource pool, or datastore
Updating VMware Tools
Using the Update-Tools cmdlet
Enabling the Check and upgrade VMware Tools before each power on checkbox
Upgrading virtual machine compatibility
Using snapshots
Creating snapshots
Retrieving snapshots
Reverting to a snapshot
Modifying snapshots
Removing snapshots
Running commands in the guest OS
Configuring Fault Tolerance
Turning Fault Tolerance on
Turning Fault Tolerance off
Opening the console of virtual machines
Removing virtual machines
Using tags
Managing tag categories
Creating tag categories
Retrieving tag categories
Modifying tag categories
Removing tag categories
Managing tags
Creating tags
Retrieving tags
Modifying tags
Removing tags
Managing tag assignments
Creating tag assignments
Retrieving tag assignments
Retrieving virtual machines by tag
Removing tag assignments
Converting custom attributes and annotations to tags
Creating tag categories from custom attributes
Creating tags from annotations
Summary
6. Managing Virtual Networks with PowerCLI
Using vSphere Standard Switches
Creating vSphere Standard Switches
Configuring vSphere Standard Switches
Adding network adapters to a switch
Removing vSphere Standard Switches
Using host network adapters
Creating host network adapters
Retrieving host network adapters
Configuring host network adapters
Configuring network speed and duplex setting
Configuring the management network
Configuring vMotion
Removing host network adapters
Configuring NIC teaming
Using standard port groups
Creating standard port groups
Configuring standard port groups
Removing standard port groups
Using vSphere Distributed Switches
Creating vSphere Distributed Switches
Creating a new vSphere Distributed Switch from scratch
Cloning a vSphere Distributed Switch
Creating a vSphere Distributed Switch from an export
Retrieving vSphere Distributed Switches
Configuring vSphere Distributed Switches
Rolling back the configuration of a vSphere Distributed Switch
Importing the configuration of a vSphere Distributed Switch from a backup
Upgrading a vSphere Distributed Switch
Adding hosts to vSphere Distributed Switches
Retrieving hosts connected to vSphere Distributed Switches
Adding host physical network adapters to a vSphere Distributed Switch
Removing host physical network adapters from a vSphere Distributed Switch
Removing hosts from a vSphere Distributed Switch
Exporting the configuration of vSphere Distributed Switches
Removing vSphere Distributed Switches
Using distributed virtual port groups
Creating distributed virtual port groups
Creating distributed virtual port groups from a reference group
Creating distributed virtual port groups from an export
Retrieving distributed virtual port groups
Modifying distributed virtual port groups
Renaming a distributed virtual port group
Rolling back the configuration of a distributed virtual port group
Restoring the configuration of a distributed virtual port group
Configuring network I/O control
Enabling network I/O control
Retrieving the network I/O control enabled status
Disabling network I/O control
Exporting the configuration of distributed virtual port groups
Migrating a host network adapter from a standard port group to a distributed port group
Removing distributed virtual port groups
Configuring host networking
Configuring the network of virtual machines
Setting the IP address
Setting the DNS server addresses
Retrieving the network configurations
Summary
7. Managing Storage
Rescanning for new storage devices
Creating datastores
Creating NFS datastores
Getting SCSI LUNs
Creating VMFS datastores
Creating software iSCSI VMFS datastores
Retrieving datastores
Setting the multipathing policy
Configuring vmhba paths to an SCSI device
Retrieving vmhba paths to an SCSI device
Modifying vmhba paths to an SCSI device
Working with Raw Device Mappings
Configuring storage I/O control
Retrieving Storage I/O Control settings
Configuring Storage DRS
Creating a datastore cluster
Retrieving datastore clusters
Modifying datastore clusters
Adding datastores to a datastore cluster
Retrieving the datastores in a datastore cluster
Removing datastores from a datastore cluster
Removing datastore clusters
Upgrading datastores to VMFS-5
Removing datastores
Using VMware vSAN
Configuring VMware vSAN networking
Enabling VMware vSAN on vSphere clusters
Retrieving the devices available for VMware vSAN
Creating VMware vSAN disk groups
Retrieving VMware vSAN disk groups
Adding a host SCSI disk to a VMware vSAN disk group
Retrieving the host disks that belong to a VMware vSAN disk group
Removing disks from a VMware vSAN disk group
Removing VMware vSAN disk groups
Using vSphere storage policy-based management
Retrieving storage capabilities
Using tags to define storage capabilities
Creating SPBM rules
Creating SPBM rule sets
Creating SPBM storage policies
Retrieving SPBM storage policies
Modifying SPBM storage policies
Retrieving SPBM compatible storage
Using SPBM to create virtual machines
Retrieving SPBM-related configuration data of clusters, virtual machines, and hard disks
Associating storage policies with virtual machines and hard disks and enabling SPBM on clusters
Exporting SPBM storage policies
Importing SPBM storage policies
Removing SPBM storage policies
Summary
8. Managing High Availability and Clustering
Creating vSphere HA and DRS clusters
Retrieving clusters
Retrieving the HA master or primary hosts
Retrieving cluster configuration issues
Modifying the cluster settings
Configuring enhanced vMotion compatibility (EVC) mode
Disabling HA
Disabling or enabling host monitoring
Enabling VM and application monitoring
Configuring the heartbeat datastore selection policy
Moving hosts to clusters
Moving clusters
Using DRS rules
Creating VM-VM DRS rules
Creating VM-host DRS rules
Creating virtual machines DRS groups
Creating hosts DRS groups
Retrieving DRS groups
Modifying DRS groups
Adding virtual machines to a DRS group
Removing virtual machines from a DRS group
Removing DRS groups
Creating Virtual Machines to Hosts DRS rules
Retrieving DRS Rules
Modifying DRS rules
Removing DRS rules
Using DRS recommendations
Using resource pools
Creating resource pools
Retrieving resource pools
Modifying resource pools
Moving resource pools
Configuring resource allocation between virtual machines
Removing resource pools
Using Distributed Power Management
Enabling DPM
Configuring hosts for DPM
Testing hosts for DPM
Putting hosts into standby mode
Starting hosts
Retrieving the DPM configuration of a cluster
Disabling DPM
Removing clusters
Summary
9. Managing vCenter Server
Working with roles and permissions
Retrieving privileges
Using roles
Creating roles
Retrieving roles
Modifying roles
Removing roles
Using permissions
Creating permissions
Retrieving permissions
Modifying permissions
Removing permissions
Managing licenses
Adding license keys to the license inventory
Retrieving license keys from the license inventory
Removing license keys from the license inventory
Assigning licenses to hosts
Retrieving assigned licenses
Using the LicenseDataManager
Associating license keys with host containers
Applying the associated license key to all hosts
Retrieving license key associations
Retrieving all of the license key associations to the host containers in your environment
Retrieving the license keys associated with a specific host container
Retrieving the effective license key of a host container
Modifying license key associations
Removing license key associations
Configuring alarms
Retrieving alarm definitions
Modifying alarm definitions
Creating alarm actions
Configuring the vCenter Server mail server and sender settings
Retrieving alarm actions
Removing alarm actions
Creating alarm action triggers
Retrieving alarm action triggers
Removing alarm action triggers
Retrieving events
Summary
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
Retrieving baselines
Retrieving patch baselines
Creating patch baselines
Modifying patch baselines
Attaching baselines to inventory objects
Detaching baselines from inventory objects
Removing baselines
Testing inventory objects for compliance with baselines
Retrieving baseline compliance data
Initializing staging of patches
Remediating inventory objects
Upgrading or patching ESXi hosts
Upgrading virtual machine hardware
Summary
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
Retrieving vApp templates
Creating vCloud vApps
Retrieving vCloud vApps
Starting vCloud vApps
Stopping vCloud vApps
Managing vCloud virtual machines
Creating vCloud virtual machines
Retrieving vCloud virtual machines
Starting vCloud virtual machines
Stopping vCloud virtual machines
Using the vCloud Director API with Get-CIView
Removing vCloud virtual machines
Removing vCloud virtual appliances
Creating snapshots
Retrieving snapshots
Reverting to snapshots
Removing snapshots
Disconnecting from vCloud Director servers
Summary
12. Using Site Recovery Manager
Installing SRM
Connecting to SRM servers
Downloading and installing the Meadowcroft.SRM module
Pairing SRM sites
Retrieving the name of the local vCenter Server
Retrieving the remote vCenter Server
Retrieving the SRM user info
Managing protection groups
Creating protection groups
Retrieving protection groups
Protecting virtual machines
Retrieving protected virtual machines
Unprotecting virtual machines
Managing recovery plans
Retrieving recovery plans
Running recovery plans
Retrieving the historical results of recovery plans
Disconnecting from SRM servers
Summary
13. Using vRealize Operations Manager
Connecting to vRealize Operations Manager servers
Retrieving vRealize Operations Manager resource objects
Using alerts
Retrieving alert definitions
Retrieving alert types
Retrieving alert subtypes
Modifying alerts
Retrieving recommendations
Retrieving statistic keys
Retrieving statistical data
Retrieving local user accounts
Using the vRealize Operations Manager API
Getting the user roles
Creating users
Removing users
Retrieving solutions
Retrieving traversalSpecs
Creating reports
Retrieving reports
Disconnecting from vRealize Operations Manager servers
Summary
14. Using REST API to manage NSX and vRealize Automation
Connecting to REST API servers
Managing NSX logical switches
Creating NSX logical switches
Retrieving NSX logical switches
Removing NSX logical switches
Managing NSX logical (distributed) routers
Creating NSX logical (distributed) routers
Retrieving NSX logical (distributed) routers
Removing NSX logical (distributed) routers
Managing NSX Edge services gateways
Retrieving NSX Edge services gateways
Removing NSX Edge services gateways
Connecting to vRA servers
Managing vRA tenants
Creating vRA tenants
Retrieving vRA tenants
Removing vRA tenants
Retrieving vRA business groups
Managing vRA reservations
Creating vRA reservations
Retrieving vRA reservations
Managing vRA machines and applications
Retrieving entitled catalog items
Retrieving a template request for an entitled catalog item
Creating vRA machines
Viewing details of a machine request
Retrieving provisioned resources
Summary
15. Reporting with PowerCLI
Retrieving log files
Creating log bundles
Performance reporting
Retrieving the statistical intervals
Retrieving performance statistics
Retrieving metric IDs
Exporting reports to CSV files
Generating HTML reports
Sending reports by e-mail
Reporting the health of your vSphere environment with vCheck
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜