6.0

Table Of Contents
VMware, Inc. 11
Chapter 1 Getting Started with vSphere SDK for Perl
3FollowtheseprogrammingconventionswhenyoumodifyorcreatevSphereSDKforPerlscripts:
Useparameternamesfollowedbyparametervalues,asfollows:
Vim::<subroutine>(<parameter_name>=><value>, <parameter_name>=><value> );
Util::<subroutine>(<parameter_name>=><value>, <parameter_name>=><value> );
Opts::<subroutine>(<parameter_name>=><value>, <parameter_name>=><value> );
UsetheoptionsinTable 13,“OptionsAvailableforAllSDKforPerlCommands,onpage 16to
specifyconnectioninformation.
Usethemechanismdiscussedin“Step2:(Optional)DefineScriptSpecificCommandLineOptions”
onpage 20forspecifyingadditionalscriptspecificoptions.
Common vSphere SDK for Perl Tasks
ThevSphereSDKforPerlincludesutilityapplicationsandsamplescriptsforcommonadministrationtasks.
Sometasksrequireadditionalscripting.SeeChapter 2,“WritingvSphereSDKforPerlScripts,”onpage 19.
vSphere SDK for Perl Programming Conventions
SeveralprogrammingconventionsaredifferentthanyoumightexpectbecausetheSDKinteractswithaserver
usingSOAP/WSDL.
BooleandatatypesSDKapplicationssendandreceiveBooleanvaluesasfollows:
Input(sendingfromtheclientapplication):
Source Description
“WritingvSphereSDKforPerlScripts”on
page 19.
Indepthdiscussionofscriptsthatincludesanexample.
Chapter 4,“vSphereSDKforPerl
SubroutineReference,”onpage 41.
ReferencetovSphereSDKforPerlsubroutines.
“WebServicesforManagementPerl
Library”onpage 51.
AllowsyoutowritescriptsthatretrieveCIMdatafromthe
ESX/ESXihostusingCIMOM,aservicethatprovidesstandardCIM
managementfunctionsoveraWBEM(WebBasedEnterprise
Management).
“CredentialStorePerlLibrary”onpage 61. AllowsvSphereSDKforPerlapplicationstomanagethevSphere
credentialstore.
vSphereAPIReferencedocumentation. Referencetotheserversideobjectyourscriptinteractswith.
Table 1-1. Common Administrative Tasks and SDK Utilities
Task Script Location
Discovery(loggingin) connect.pl /apps/general
Performancemonitoring viperformance.pl(retrieves
performancecountersfromhost)
/apps/performance
Virtualmachinepoweroperations vmcontrol.pl /apps/vm
Virtualmachinesnapshotandrestorefunctionality vmsnapshot.pl,snapshotmanager.pl /apps/vm
Virtualmachinemigration vmmigrate.pl /apps/vm
Hostoperations,forexample,addingastandalone
hosttoavCenterServersystem,shuttingdownand
rebootingahost,andsoon
hostops.pl /apps/host
Viewingorchanging
ofCPUormemoryshare
allocationonavirtualmachine
sharesmanager.pl /apps/vm