VCAP5-DCA Objective 8.1 – Execute VMware Cmdlets and customize scripts using PowerCLI

Objectives

  • 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

Official Documentation:
vSphere Power CLI User’s Guide 5.0, Chapter 3 “Installing vSphere PowerCLI”, page 15.

Summary:
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:

Set-ExecutionPolicy RemoteSigned

Other references:

  • A

Install and configure Update Manager PowerShell Library

Official Documentation:
VMware vSphere Update Manager PowerCLI Installation and Administration Guide

Summary:
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

Other references:

  • A

Use basic and advanced Cmdlets to manage VMs and ESXi Hosts

Official Documentation:
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, page 17.

Summary:
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:

Other references:

  • A

Use Web Service Access Cmdlets

Official Documentation:
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, section “API Access Cmdlets”, page 33.

Summary:
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:

  • Get-View
  • Get-VIObjectByVIView

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.

Other references:

  • A

Use Datastore and Inventory Providers

Official Documentation:
vSphere Power CLI User’s Guide 5.0, Chapter 4 “vSphere PowerCLI Usage Examples”, section “The Inventory Provider” and “The Datastore Provider”, page 35.

Summary:
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.

Figuer 1 -Datastore Provider example

Other references:

  • A

Given a sample script, modify the script to perform a given action

Official Documentation:

Summary:
This could be one of the labs on the actual exam?

Other references:

  • A
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 343 other followers

%d bloggers like this: