6.5

Table Of Contents
VMware, Inc. 9
1
ThevSphereSDKforPerlletsyouautomateawidevarietyofadministrative,provisioning,andmonitoring
tasksinthevSphereenvironment.ThischapterintroducestheSDKarchitecture,explainsthebasicusemodel,
andgetsyoustartedrunningasimplescript.
Thechapterincludesthefollowingtopics:
“vSphereSDKforPerlArchitecture”onpage 9
“UsingvSphereSDKforPerl”onpage 10
“vSphereSDKforPerlCommonOptions”onpage 12
“HelloHost:RunningYourFirstScript”onpage 17
vSphere SDK for Perl Architecture
TheinteractionmodelbetweentheSDKandthevSphereAPIonthehostdirectlyaffectshoweachscriptis
structured,andisthebasisfortroubleshooting.
vSphereSDKforPerlsubroutinesinteractwiththehostandperformvariationsofthesebasictasks:
Connecttoaremotehostusingusersuppliedconnectionparameters,anddisconnect.
Findobjectsontheremotehost(serversideobjects).Forexample,findallvirtualmachinesonahost.
Retrieveormodifyserversideobjects,forexample,managethevirtualmachinelifecycle(start,stop,
suspend,andsoon).
Collectinformationfromserversideobjects.
Managesessions.
MostroutinesretrieveavSphereAPIobjectandmakeitavailableasaPerlobject(calledaviewobject)that
youcanthenmanipulatewithyourscript.
ThevSphereSDKforPerlhasthesecomponents:
vSphereSDKforPerlRuntimeClientsideruntimecomponentsthatinclude:
AcompletePerlbindingofthevSphereAPI,whichmakesallserversideoperationsanddata
structuresavailable.TheSDKhandlesthedatatypemappingbetweenserversideandclientside
objectstransparently.
VMwarePerlmodules(VIRuntime.pmandVILib.pm)thatprovidesubroutinesforbasic
functionality.
vSphereSDKforPerlUtilityApplicationsManagementapplicationsthatyoucanrunwithout
modificationinyourvirtualdatacenter.Youruneachapplicationwithconnectionparametersandother,
applicationspecificparameters.SeethevSphereSDKforPerlUtilityApplicationsReference.
Getting Started with
vSphere SDK for Perl
1