vMA Use Cases
This section lists a few typical use cases.
Writing or Converting Scripts
You can run existing vSphere CLI or vSphere SDK for Perl scripts from vMA. To set target servers and initialize vi-fastpass, the script can use the VmaTarget.login() method of VmaTargetLib.
Writing or Converting Agents
Partners or customers can use vMA to write or convert agents.
When a partner or customer writes a new agent in Perl, the Perl script must import the VmaTargetLib Perl module and all vSphere SDK for Perl modules. Instead of calling the vSphere SDK for Perl subroutine Util::Connect(targetUrl, username, password), the agent calls VmaTargetLib::VmaTarget.login().
The agent uses code similar to the following Perl-like pseudo code to log in to ESXi hosts:
LoginToMyEsx() {
SessionManagerLocalTicket tkt = SessionManager.AcquireLocalTicket(userName);
UserSession us = sm.login(tkt.userName, tkt.passwordFilePath);
}
The partner changes the agent to use code similar to the following pseudo-code instead:
LoginToMyEsx(String myESXName) {
VmaTarget target = VmaTargetLib.query_target(myESXName);
UserSession us = target.login();
}
This pseudo-code assumes only one vMA target. For multiple target servers, the code can specify any target server or loop through a list of target servers.
Instead of calling the vSphere SDK for Perl method Util::Connect(), the agent calls the vifp library method VmaTargetLib::VmaTarget.login().