作者:empty 页数:116 出版社:empty |
This document supports the version of each product ls ted andsupports all subsequent versions until the document isreplaced by a new edition.To check for more recent editions of
The VMowrcPoucerCLI User's Guide provides informaion about install ng and using the VMware Power CLIcmd lets(pronounced command lets~) for managing, monitoring automating, and handling lifecycleoperations for VMware vSphere, VMware Site Recovery Manager, vSphere Auto mai on SDKv Cloud Director, v Cloud Air, vSphere Update Manager, v Realize Operations Manager, andVMware Horizon components.To help you start with Power CLI, this documentation in chu desde seri ptions of specifc Power CLI conceptsand features.In addition, this documentation provides a set of usage examples and sample scripts.This book is intended for anyone who needs to install and use Power CLI.This documentaion is writen foradministrators and developers who are familiar with virtual machine technology and Windows Power ShellBasic administrators can use cmd lets included in Power CLI to manage their vSphere,VMware Site Recovery Manager, vSphere Automation SDK, v Cloud Director, v Cloud Air,vSphere Update Manager, v Realize Operations Manager, and VMware Horizon infrastructure from thecommand I in e.Advanced administrators can develop Power Shell scripts that can be reused by other administrators orintegrated into other applications.
VMware Power CLI contains modules of cmd lets based on Microsoft Power Shell for automating vSphere,VMware Site Recovery Manager, vSphere Automation SDK, v Cloud Director, v Cloud Air,vSphere Update Manager, v Realize Operations Manager, and VMware Horizon administration.VMware Power CLI provides a Power Shell interface to the VMware product APIsA pipeline is a series of commands separated by the pipe operator lEach command in the pipeline receives an object from the previous command, performs some operation onit and then passes it to the next command in the pipeline.Objects are output from the pipeline as soon asthey become available.Power Shell has a number of pattern-matching operators named wildcards that you can use to substitute oneor more characters in a string, or substitute the complete string.All wildcard expressions can be used with the Power CLIc md lets.For example, you can view a list of all fileswith a.txt extension by running dir*.txt In this case, the asterisk*operator matches any combination ofcharacters.With wildcard pat tems you can indicate character ranges as well.For example, to view all fles that startwith the letter SorT and have a.txt extension, you can run dir[st] *.txt.You can use the questionmark?wildcard to match any single character within a sequence of characters.Forexample, to view all.txt files with names that consist of string and one more character at the end, run dirstring 7.txt.The Wn dows Power Shel engine retains a set of parame ler names, referred to as common parameter.AllPower Shell cmd lets, including the Power CLIc md lets, support them.Some of the Power Shell common parameters are Verbose, Debug, Error Action, Error Var table, Out Vario ble,and Out Buffer.For a full list of the common parameters and more details on their usage, run Get-HeLpob out_Cor mon Poron eters.Power Shell offers two risk m tigation parameters:Mh at If and Conf imMh at IfDisplays the effects of a command without running itPower CLl emd lets are created to automate VMware environments administration and to introduce somespecific features in addition to the Power Shell concepts.
VMware Pwer CLl Users Guide
VMware Pwer CLI User's Guide 9
1 Intrductin t VMware Pwer CLI 11
2 Installing VMware Pwer CLI 21
3 Cnfiguring VMware Pwer CLI 25
Micrsft Pwer Shell Basics 11
Pwer Shell Cmmand-Line Syntax 11
Pwer Shell Pipelines 12
Pwer Shell Wildcards 12
Pwer Shell Cmmn Parameters 12
Pwer CLI Cncepts 12
Pwer CLI Cmpnents 13
Interperability Between the Pwer CLI and v Clud Directr Pwer CLI Cmpnents 14
Selecting bjects in Pwer CLI 16
Prviding Lgin Credentials 17
Running Pwer CLIC md lets Asynchrnusly 17
Managing Default Server Cnnectins 18
Custmizatin Specificatin bjects in Pwer CLI 18
Using ESX CLI with Pwer CLI 18
Pwer CLI Inventry Prvider 18
Pwer CLI Datastre Prvider 19
Pwer CLI Abut Articles 19
Supprted perating Systems 22
Supprted VMware Prducts 22
Supprted Windws Pwer 5hell Versins 22
Prerequisites fr Installing and Running Pwer CLI 22
Install Pwer CLI 22
Set the Prperties t Supprt Remte Signing 23
Uninstall Pwer CLI 23
Scped Settings f Pwer CLI 25
Cnfiguring the Scpe f the Pwer CLI Settings 25
Pririty f Settings Scpes in Pwer CLI 26
Pwer CLI Cnfiguratin Files 26
Lading theSe rip tCn i gura n File f Pwer CLI 27
Lad the Script Cnfigura in File in ther Pwer Shell Tls 27
Custmizing Pwer CLIwith5criptCnf guratin Files 28
Using Custm Seri pts t Extend the peratingSystem Supprt fr Pwer CLIC md lets 28
Categries f Infrmatin That VMware Receives 29
Jin the Custmer Experience Imprvement Prgram in Pwer CLI 29
Cnnect t av Center Server System 34
Manage Virtual Machines n v Sphere 35
Add a Standalne Hst t av Center Server System 35
Set the License Key fr aH stny Center Server 36
Activate Maintenance Mde fr a Hst n v Center Server . 36
Create v Sphere Inventry bjects 37
Create Virtual Machines n v Center Server Using an XML Specificatin File 37
Manage Virtual Machine Template sny Center Server 38
Create and Use Snapshts n v Center Server 39
Update the Resurce Can figuratin Settings f a Virtual Machine n v Center Server 39
Get a List f Hsts n av Center Server System and View Their Prperties 40
Change the Hst Advanced Cnf guratinS ettngsnvCenterServer4D
Mve a Virtual Machine t a Different Hst Using VMware v Sphere v Mtin 41
Mve a Virtual Machine t a Different Datastre Using VMware v Sphere Strage v Mtin 41
Create a Hst Prf lena v Center Server System 41
Apply a Hst Prf le t a Hst n v Center Server 42
Manage Statistics and Statistics Intervals n v Center Server 42
Mdify the Settings f the NIC Teaming Plicy fr a Virtual Switch 43
Create av App n v Center Server 43
Mdify the Prperties f av App 43
Exprt r Imprt v Apps 44
Create an iS CSl Hst Strage 44
Add Passthrugh Devices t a Hst and Virtual Machine 45
Create a Custm Prperty Based n an Extensin Data Prperty 45
Create a Script-Based Custm Prperty fr av Sphere bject 45
Apply a Custmizatin bject t a Clned Virtual Machine 46
Mdify the Default NIC Mapping bject f a Custmizatin Specif catin 46
Mdify Multiple NIC Mapping bjects f a Custmizatin Specif catin 47
Create Multiple Virtual Machines that Use Static IP Addresses 47
Create Multiple Virtual Machines with Tw Netwrk Adapters 48
Create av Sphere Rle and Assign Permissins t a User 50
View the Actin Triggers furan Alarm n v Center Server 5D
Create and Mdify Alarm Actins and Alarm Triggers n v Center Server 51
Remve Alarm Actins and Triggers 51
Create and Mdify Advanced Settings fr a Cluster 52
Mdify the v Center Server Email Cni guratin 52
Mdify the v Center Server SNMP Cnfiguratin 53
Use Esx tp t Get Infrmain n the Virtual CPUs f a Virtual Machine 53
Filter v Sphere bjects with Get-View 54
Ppulate a View bject with Get-View 54
Update the State f a Server-Side bject 54
Rebt a Hst with Get-View 55
Mdify the CPU Levels f a Virtual Machine with Get-View and Get-VI bject By VI View 55
Brwse the Default inventry Drive 56
4 Cnfiguring Custmer Experience Imprvement Prgram 29
5 Sample Scripts fr Managing v Sphere with VMware Pwer CLI 31
Create a New Custm Inventry Drive 56
Manage Inventry bjects Thrugh Inventry Drives 57
Brwse the Default Datastre Drives 57
Create a New Custm Datastre Drive 58
Manage Data stres Thrugh Datastre Drives 58
Mdify the Timeut Setting fr Web Tasks 59
Using Tags 60
Retrieve a Tag and Save It int a Variable 6D
Retrieve a Tag Categry and Save It int a Van able 60
Create a Tag Categry and a Tag 60
Assign a Tag t Virtual Machines 61
Retrieve bjects by Tag 61
Generate Tags Autma ically by Using a Seri pt 61
Add an Entity Type t a Tag Categry 62
Retrieve Tag Assignments 62
Netwrk Management with v Sphere Distributed Switches 62
Create a Distributed Switch and Cnfigure Netwrking 62
Cnfigure a Distributed Switch 63
Migrate Virtual Machine Netwrking Cnfiguratin frm av Sphere Standard Switch t a
v Sphere Distributed Switch 63
Migrate Physical and Virtual NICs t av Sphere Standard Switch 64
Migrate Physical and Virtual NICs t av Sphere Distributed Switch 64
Cnfigure the Traffic Shaping Plicy 65
Cnfigure the Security Plicy 65
Create a Virtual Machine frm a Cntent Library Item 66
Create av App frm a Cntent Library Item 66
VMware Pwer CLI 67
Create a Tag-Based Strage Plicy 67
Create a Capability-Based Strage Plicy 6B
Assciate a Strage Plicy with a Virtual Machine and Its HardDisk 68
Disassciate a Strage Plicy Assciated with a Virtual Machine and Its HardDisk 69
EnableS PB Mna Cluster and Verify that It Is Enabled 69
Remve a Strage Plicy 70
Edit a Strage Plicy 70
Exprt and Imprt a Strage Plicy 7I
Create a Virtual Machine in a Datastre Cmpatible with Strage Plicy 71
Create a Virtual SAN Datastre 72
Mdify a Virtual SAN Datastre 73
Create a Virtual SAN Stretched Cluster 74
Create an NFS 4.1 Datastre 75
Add a VASA Prvider and Create a Plicy 76
Invke a Planned Failver n a Replicatin Grup and Reverse the Replicatin 76
Attach a Flat V Disk t a Virtual Machine 78
VMware Pwer CLI 79
Cnnect t an SRM Server 79
Prtect a Virtual Machine 8
Create a Reprt f the Prtected Virtual Machines 80
Create a Reprt f the Virtual Machines Assciated with All Pru tectin Grups 81
VMware Pwer CLl 83
Create a Lcal Cntent Library n an Existing Datastre 83
Cnnect t av Clud Directr Server 86
Create and Manage rganizatins 86
Create and Manage rganizatin Virtual DataCenters 87
Filter and Retrieve rganizatin Virtual DataCenter Netwrks 88
Imprt av App Template frm the Lcal Strage 88
Create av App Template frm av App 88
Imprt av App frm v Sphere 89
Create and Mdity av App 89
Manage Virtual Machines with v Apps 90
Manage Virtual Machines and Their Guest perating Systems 90
Retrieve a List f the Internal and External lP Addresses f Virtual Machines in v Apps 91
Create and Manage AccessCntrl Rules 92
Filter and Retrieve v App Netwrks 92
Create v App Netwrks fr a Selected v ApP 93
Create an Islated v App Netwrk 93
Create anN AT Rute dv App Netwrk 93
Create a Directv App Netwrk 94
Mdify r Remve v App Netwrks 94
Cnnect t av Clud Air Server 97
Retrieve v Apps frm a DataCenter 98
Retrieve v Apps frm a Cmpute Instance 98
Running v Clud Directr Scripts Against v Clud Air 98
VMware Pwer CLI 101
Cnnect t av Center Server System 101