Configure an ESX agency and ESX agents
You must define the configuration of the ESX agencies in the implementation of the solution. You set the configuration for ESX agencies and ESX agents in the
AgencyConfigInfo
and AgentConfigInfo
data objects.When you create ESX agencies, you provide the
AgencyConfigInfo
object with an array of AgentConfigInfo
objects for each version of ESXi
on which the agency deploys ESX agents. You also define the name of the ESX agency and of the ESX agents and the scope of the ESX agency in the AgencyConfigInfo
object.You define the deployment of the ESX agent virtual machines in the
AgentConfigInfo
object. You set the following information in the AgentConfigInfo
object.- A URL to the Open Virtualization Format (OVF) file from which to deploy the ESX agent.
- A URL to an optional vSphere Installation Bundle (VIB) that adds function toESXi, for example a VMkernel module or a customESXiapplication that you developed.
The URL to the ESX agent virtual machine OVF and the URL to an optional VIB must lead to a server that ESX Agent Manager can access. ESX Agent Manager downloads the ESX agent virtual machine from the URLs that you provide and deploys the virtual machines on the
ESXi
hosts. ESX Agent Manager installs one ESX agent instance per agency per host.To install VIBs, all
ESXi
hosts must have configured the firewall so that they can access the HTTP port on the vCenter Server
instance.Setting the
ovfEnvironment
property allows a solution to provide OVF properties specific to the ESX agent virtual machine. ESX Agent Manager sets the OVF properties when it deploys an ESX agent. A typical use of the ovfEnvironment
field is to specify the IP address and credentials of the solution so that ESX agents can connect back to the solution when they are running.- Create a program to configure and create ESX agencies and agents.Your solution can define the configuration and creation of ESX agencies and agents in theMyAgentHandler.javaclass.public MyAgentHandler(String selfUrl, String selfIp, String ovfUrl4x, String ovfUrl50, String vibUrl4x, String vibUrl50, boolean deployVibs, Map<String, String> ovfEnvironment, VcUtils vcUtils) { _vcUtils = vcUtils; _agentConfigInfo4x = new AgentConfigInfo(); _agentConfigInfo50 = new AgentConfigInfo(); [...] }
- CreateAgentConfigInfoinstances for each type of ESX agent that the ESX agency deploys.Your solution can define ESX agents forESXi6.7 and forESXi7.0.public AgentHandler([...]) { [...] _agentConfigInfo67 = new AgentConfigInfo(); _agentConfigInfo70 = new AgentConfigInfo(); [...] }
- Set the URLs to the OVF files from which the solution deploys ESX agent virtual machines by calling theAgentConfigInfo.setOvfPackageUrl()method.Your solution can construct the URLs to OVF files from information that you set in themysolution.propertiesfile.public MyAgentHandler([...]) { [...] _agentConfigInfo67.setOvfPackageUrl(urlPrefix + ovfUrl4x); _agentConfigInfo70.setOvfPackageUrl(urlPrefix + ovfUrl50); [...] }
- Set the URLs to the optional VIB files from which the solution adds functions toESXiby calling theAgentConfigInfo.setVibUrl()method.Your solution can construct the URLs to VIB files from information that you set in themysolution.propertiesfile.public MyAgentHandler([...]) { [...] _agentConfigInfo4x.setOvfPackageUrl(urlPrefix + ovfUrl4x); _agentConfigInfo50.setOvfPackageUrl(urlPrefix + ovfUrl50); if (deployVibs) { _agentConfigInfo67.setVibUrl(urlPrefix + vibUrl4x); _agentConfigInfo70.setVibUrl(urlPrefix + vibUrl50); [...] } }
- Set any OVF environment properties that the solution requires by creating an instance of theAgentOvfEnvironmentInfoobject and passing it to theAgentConfigInfoobject for each ESX agent.Your solution can set some dummy properties in theeamri-webapp.xmlfile.public MyAgentHandler([...]) { [...] AgentOvfEnvironmentInfo ovfEnv = new AgentOvfEnvironmentInfo(); for (final Map.Entry<String, String> entry : ovfEnvironment.entrySet()) { ovfEnv.getOvfProperty().add(new AgentOvfEnvironmentInfoOvfProperty() { { setKey(entry.getKey()); setValue(entry.getValue()); } }); } _agentConfigInfo67.setOvfEnvironment(ovfEnv); _agentConfigInfo70.setOvfEnvironment(ovfEnv); [...] }
- Create an instance ofAgencyConfigInfoto define the ESX agency that the solution deploys.public MyAgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); [...] }
- Provide names for the ESX agency and the ESX agents by calling theAgencyConfigInfo.setAgencyName()andsetAgentName()methods.Your solution can name the ESX agency and the ESX agents My Service.public MyAgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); _agencyConfigInfo.setAgencyName("My Service"); _agencyConfigInfo.setAgentName("My Service"); [...] }
- Add an array of ESX agent configurations to the ESX agency configuration by calling theAgencyConfigInfo.getAgentConfig()method.public MyAgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); _agencyConfigInfo.setAgencyName("My Service"); _agencyConfigInfo.setAgentName("My Service"); _agencyConfigInfo.getAgentConfig().add(_agentConfigInfo4x); _agencyConfigInfo.getAgentConfig().add(_agentConfigInfo50); [...] }
- Set the scope of the ESX Agency by calling theAgencyConfigInfo.setScope()method.Users of your solution can set the scope of the ESX agency by selectingESXihosts from your solution Configuration page. Consequently, the scope is empty until your solution updates it according to the user interaction.public MyAgentHandler([...]) { [...] _agencyConfigInfo.setScope(null); [...] }
You set the configuration properties for an ESX agency and the ESX agents that it contains.
Call the
createAgency()
method to create the ESX agency.