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.

1<br />

Getting Started with<br />

1<br />

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

The <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> lets you automate a wide variety of administrative, provisioning, and monitoring<br />

tasks in the <strong>vSphere</strong> environment. This chapter introduces the <strong>SDK</strong> architecture, explains the basic use model,<br />

and gets you started running a simple script.<br />

The chapter includes the following topics:<br />

“<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Architecture” on page 9<br />

“Using <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong>” on page 10<br />

“<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Common Options” on page 12<br />

“Hello Host: Running Your First Script” on page 17<br />

<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Architecture<br />

The interaction model between the <strong>SDK</strong> and the <strong>vSphere</strong> API on the host directly affects how each script is<br />

structured, and is the basis <strong>for</strong> troubleshooting.<br />

All <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> subroutines interact with the host and per<strong>for</strong>m variations of these basic tasks:<br />

Connect to a remote host using user‐supplied connection parameters, and disconnect.<br />

Find objects on the remote host (server‐side objects). For example, find all virtual machines on a host.<br />

Retrieve or modify server‐side objects, <strong>for</strong> example, manage the virtual machine life cycle (start, stop,<br />

suspend, and so on).<br />

Collect in<strong>for</strong>mation from server‐side objects.<br />

Manage sessions.<br />

Most routines retrieve a <strong>vSphere</strong> API object and make it available as a <strong>Perl</strong> object (called a view object) that<br />

you can then manipulate with your script.<br />

The <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> has these components:<br />

<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Runtime – Client‐side runtime components that include:<br />

A complete <strong>Perl</strong> binding of the <strong>vSphere</strong> API, which makes all server‐side operations and data<br />

structures available. The <strong>SDK</strong> handles the data type mapping between server‐side and client‐side<br />

objects transparently.<br />

<strong>VMware</strong> <strong>Perl</strong> modules (VIRuntime.pl and VILib.pl) that provide subroutines <strong>for</strong> basic<br />

functionality.<br />

<strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Utility Applications – Management applications that you can run without<br />

modification in your virtual datacenter. You run each application with connection parameters and other,<br />

application‐specific parameters. See the <strong>vSphere</strong> <strong>SDK</strong> <strong>for</strong> <strong>Perl</strong> Utility Applications Reference.<br />

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

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

Saved successfully!

Ooh no, something went wrong!