18.08.2013 Views

vSphere SDK for Perl Programming Guide - Documentation - VMware

vSphere SDK for Perl Programming Guide - Documentation - VMware

vSphere SDK for Perl Programming Guide - Documentation - VMware

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The following materials are available <strong>for</strong> modifying or writing scripts:<br />

Source Description<br />

“Writing <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Scripts” on<br />

page 19.<br />

Chapter 4, “<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong><br />

Subroutine Reference,” on page 41.<br />

“Web Services <strong>for</strong> Management <strong>Perl</strong><br />

Library” on page 51.<br />

Chapter 1 Getting Started with <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong><br />

3 Follow these programming conventions when you modify or create <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> scripts:<br />

Use parameter names followed by parameter values, as follows:<br />

Vim::(=>, => );<br />

Util::(=>, => );<br />

Opts::(=>, => );<br />

Use the options in Table 1‐3, “Options Available <strong>for</strong> all <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Scripts,” on page 15 to<br />

specify connection in<strong>for</strong>mation.<br />

Use the mechanism discussed in “Step 2: (Optional) Define Script‐Specific Command‐Line Options”<br />

on page 20 <strong>for</strong> specifying additional script‐specific options.<br />

Common <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Tasks<br />

In‐depth discussion of scripts that includes an example.<br />

Reference to <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> subroutines.<br />

Allows you to write scripts that retrieve CIM data from the<br />

ESX/ESXi host using CIMOM, a service that provides standard CIM<br />

management functions over a WBEM (Web‐Based Enterprise<br />

Management).<br />

“Credential Store <strong>Perl</strong> Library” on page 61. Allows <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> applications to manage the <strong>vSphere</strong><br />

credential store.<br />

<strong>vSphere</strong> API Reference documentation. Reference to the server‐side object your script interacts with.<br />

The <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> includes utility applications and sample scripts <strong>for</strong> common administration tasks.<br />

Table 1-1. Common Administrative Tasks and <strong>SDK</strong> Utilities<br />

Task Script Location<br />

Discovery (logging in) connect.pl /apps/general<br />

Per<strong>for</strong>mance monitoring viper<strong>for</strong>mance.pl (retrieves<br />

per<strong>for</strong>mance counters from host)<br />

Virtual machine power operations vmcontrol.pl /apps/vm<br />

Virtual machine snapshot and restore functionality vmsnapshot.pl, snapshotmanager.pl /apps/vm<br />

Virtual machine migration vmmigrate.pl /apps/vm<br />

Host operations, <strong>for</strong> example, adding a standalone<br />

host to a vCenter Server system, shutting down and<br />

rebooting a host, and so on<br />

Viewing or changing of CPU or memory share<br />

allocation on a virtual machine<br />

/apps/per<strong>for</strong>mance<br />

hostops.pl /apps/host<br />

sharesmanager.pl /apps/vm<br />

Some tasks require additional scripting. See Chapter 2, “Writing <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Scripts,” on page 19.<br />

<strong>VMware</strong>, Inc. 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!