- Install and configure vSphere PowerCLI
- Install and configure Update Manager PowerShell Library
- Use basic and advanced Cmdlets to manage VMs and ESXi Hosts
- Use Web Service Access Cmdlets
- Use Datastore and Inventory Providers
- Given a sample script, modify the script to perform a given action
Install and configure vSphere PowerCLI
vSphere Power CLI User’s Guide 5.0, Chapter 3 “Installing vSphere PowerCLI”, page 15.
vSphere Power CLI User’s Guide 5.0, Chapter 2 “vSphere PowerCLI System Requirements” presents an overview of the supported Operating Systems, required software and supported VMware environments.
Windows versions starting from XP SP2 are supported. To run vSphere PowerCLI, you need:
- .NET 2.0 SP1
- Windows PowerShell 1.0/2.0
Most VMware environments are supported.
vSphere PowerCLI can be downloaded from: http://www.vmware.com/go/powercli
Installation is straightforward. If the PowerShell Execution Policy on your machine is set incorrectly, a warning message appears before finalizing the vSphere PowerCLI installation. Ignore it and continue with the installation.
For security reasons, Windows PowerShell supports an execution policy feature. It determines whether scripts are allowed to run and whether they must be digitally signed. By default, the execution policy is set to Restricted, which is the most secure policy. If you want to run scripts or load configuration files, you can change the execution policy by using the Set-ExecutionPolicy cmdlet.
Start the vSPhere PowerCLI console and type:
Install and configure Update Manager PowerShell Library
VMware vSphere Update Manager PowerCLI Installation and Administration Guide
The documentation provides detailed information. In fact, you need to complete the previous step before installing the Update Manager PowerCLI.
The download location is: http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli/updatemanager
Use basic and advanced Cmdlets to manage VMs and ESXi Hosts
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, page 17.
In my case, to get up to speed with Windows PowerShell and especially the vSphere PowerCLI, I have watched the Trainsignal Course on this subject, see my post.
vSphere Power CLI User’s Guide 5.0, Chapter 4, presents the first steps on using the vSphere PowerCLI, from connecting to a vCenter Server, performing Basic and Advanced Tasks.
There is an overwhelming amount of information on this subject, like:
- VMware Communities on PowerCLI;
- VMware PowerCLI Blog;
- Some well-known bloggers, like: http://www.virtu-al.net/ (Alan Renouf) and http://www.lucd.info/ (Luc Dekens )
- Another comprehensive Getting Started post by David Davis.
Use Web Service Access Cmdlets
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, section “API Access Cmdlets”, page 33.
The title of this objective is a bit confusing and comes from the 4.x documentation. In the current version this is “API Access Cmdlets“.
The vSphere PowerCLI list of cmdlets includes two API Access cmdlets:
They enable access to the programming model of the vSphere SDK for .NET from PowerShell and can be used to initiate vSphere .NET objects
The documentation presents some usage examples.
Use Datastore and Inventory Providers
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, section “The Inventory Provider” and “The Datastore Provider”, page 35.
The Inventory Provider (VimInventory) is designed to expose a raw inventory view of the inventory items from a server. It enables interactive navigation and file-style management of the VMware vSphere inventory.
When you connect to a server with Connect-VIServer, the cmdlet builds two default inventory drives: vi and vis. The vi inventory drive shows the inventory on the last connected server. The vis drive contains the inventory all vSphere servers connected within the current vSphere PowerCLI session.
The Datastore Provider (VimDatastore) is designed to provide access to the contents of one or more datastores. The items in a datastore are files that contain configuration, virtual disk, and the other data associated with a virtual machine.All file operations are case-sensitive.
When you connect to a server with Connect-VIServer, the cmdlet builds two default datastore drives: vmstores and vmstore. The vmstore drive displays the datastores available on the last connected vSphere server. The vmstores drive contains all datastores available on all vSphere servers connected within the current vSphere PowerCLI session.
Example: for some commands, like registering a VM with the New-VM Cmdlet, you will need to know the full path to the Datastore.
Given a sample script, modify the script to perform a given action
This could be one of the labs on the actual exam?