6.0
Table Of Contents
- vSphere SDK for Perl Programming Guide
- Contents
- Getting Started with vSphere SDK for Perl
- Writing vSphere SDK for Perl Scripts
- Refining vSphere SDK for Perl Scripts
- Creating and Using Filters
- Filtering Views Selectively Using Properties
- Retrieving the ServiceInstance Object on a vSphere Host
- Saving and Using Sessions
- Using Multiple Sessions
- Learning About Object Structure Using Data::Dumper
- Specifying Untyped Arguments in Scheduled Tasks and Callbacks
- Using Advanced Subroutines
- vSphere SDK for Perl Subroutine Reference
- Web Services for Management Perl Library
- Credential Store Perl Library
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:
Connecttoaremotehostusinguser‐suppliedconnectionparameters,anddisconnect.
Findobjectsontheremotehost(server‐sideobjects).Forexample,findallvirtualmachinesonahost.
Retrieveormodifyserver‐sideobjects,forexample,managethevirtualmachinelifecycle(start,stop,
suspend,andsoon).
Collectinformationfromserver‐sideobjects.
Managesessions.
MostroutinesretrieveavSphereAPIobjectandmakeitavailableasaPerlobject(calledaviewobject)that
youcanthenmanipulatewithyourscript.
ThevSphereSDKforPerlhasthesecomponents:
vSphereSDKforPerlRuntime–Client‐sideruntimecomponentsthatinclude:
AcompletePerlbindingofthevSphereAPI,whichmakesallserver‐sideoperationsanddata
structuresavailable.TheSDKhandlesthedatatypemappingbetweenserver‐sideandclient‐side
objectstransparently.
VMwarePerlmodules(VIRuntime.pmandVILib.pm)thatprovidesubroutinesforbasic
functionality.
vSphereSDKforPerlUtilityApplications–Managementapplicationsthatyoucanrunwithout
modificationinyourvirtualdatacenter.Youruneachapplicationwithconnectionparametersandother,
application‐specificparameters.SeethevSphereSDKforPerlUtilityApplicationsReference.
Getting Started with
vSphere SDK for Perl
1