5.0
Table Of Contents
- vSphere Management Assistant Guide
- Contents
- About This Book
- Introduction to vMA
- Getting Started with vMA
- Hardware Requirements
- Software Requirements
- Required Authentication Information
- Deploy vMA
- Configure vMA at First Boot
- vMA Console and Web UI
- Configure vMA for Active Directory Authentication
- Configure Unattended Authentication for Active Directory Targets
- Enable the vi-user Account
- vMA User Account Privileges
- Add Target Servers to vMA
- Running vSphere CLI for the Targets
- Reconfigure a Target Server
- Remove Target Servers from vMA
- Modifying Scripts
- Configure vMA to Use a Static IP Address
- Configure vMA to Use a DHCP Server
- Setting the Time Zone
- Shut Down vMA
- Delete vMA
- Troubleshooting vMA
- Update vMA
- Configure Automatic vMA Updates
- vMA Interfaces
- Index
VMware, Inc. 9
Chapter 1 Introduction to vMA
vMA Samples
vMAsamplesillustratethevMACLIsandtheVmaTargetLiblibrary.ThesamplesareavailableinvMAat
/opt/vmware/vma/samples.
bulkAddServers.pl–PerlsamplethataddsmultipletargetstovMA.
mcli.pl–PerlsamplethatrunsavSphereCLIcommandonmultiplevMAtargetsspecifiedinafile
suppliedasanargument.Youmustrunvifptargetbeforerunningthisscript.
listTargets.pl ‐PerlsamplethatretrievesinformationandversionofvMAtargetsusing
VmaTargetLib.
listTargets.sh ‐JavasamplethatdemonstratesuseofVmaTargetLib.
vMA Use Cases
Thissectionlistsafewtypicalusecases.
Writing or Converting Scripts
YoucanrunexistingvSphereCLIorvSphereSDKforPerlscriptsfromvMA.Tosettargetserversandinitialize
vi‐fastpass,thescriptcanusetheVmaTarget.login() methodofVmaTargetLib.
Writing or Converting Agents
PartnersorcustomerscanusevMAtowriteorconvertagents.
ApartnerorcustomerwritesanewagentinPerl.
WhenapartnerorcustomerwritesanewagentinPerl,thePerlscriptmustimporttheVmaTargetLib
PerlmoduleandallvSphereSDKforPerlmodules.InsteadofcallingthevSphereSDKforPerlsubroutine
Util::Connect(targetUrl, username, password),theagentcalls
VmaTargetLib::VmaTarget.login().
ApartnerorcustomerrunsanagentwritteninPerlorJavaintheserviceconsoleandwantstoportthe
agenttovMA.
TheagentusescodesimilartothefollowingPerl‐likepseudocodetologintoESXihosts:
LoginToMyEsx() {
SessionManagerLocalTicket tkt = SessionManager.AcquireLocalTicket(userName);
UserSession us = sm.login(tkt.userName, tkt.passwordFilePath);
}
Thepartnerchangestheagenttousecodesimilartothefollowingpseudo‐codeinstead:
LoginToMyEsx(String myESXName) {
VmaTarget target = VmaTargetLib.query_target(myESXName);
UserSession us = target.login();
}
Thispseudo‐codeassumesonlyonevMAtarget.Formultipletargetservers,thecodecanspecifyany
targetserverorloopthroughalistoftargetservers.
ApartnerorcustomerrunsanagentwritteninPerloutsidetheESXihostandportstheagenttovMA.
InsteadofcallingthevSphereSDKforPerlmethodUtil::Connect(),theagentcallsthevifplibrary
methodVmaTargetLib::VmaTarget.login().