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.
- Verify that you have set up and started the EAM Sample Solution in an application server.
- Openin a text editor.eam_work_folder\src\com\vmware\eam\sample\solution\AgentHandler.java
When you create ESX agencies,
you provide the
AgencyConfigInfo
object
with an array of
AgentConfigInfo
objects
for each version of ESX Server 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 to the ESX Server, for example a VMkernel module or a custom ESX application 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
ESX hosts. ESX Agent Manager installs one ESX agent instance per agency per
host.
To install VIBS, all
hosts must
have configured the firewall so that they can access the HTTP port on the
vCenter Server.
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.The EAM Sample Solution defines the configuration and creation of ESX agencies and agents in theAgentHandler.javaclass.public AgentHandler(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.The EAM Sample Solution defines ESX agents for ESX Server 4.x and for ESX Server 5.0.public AgentHandler([...]) { [...] _agentConfigInfo4x = new AgentConfigInfo(); _agentConfigInfo50 = new AgentConfigInfo(); [...] }
- Set the URLs to the OVF files from which the solution deploys ESX agent virtual machines by calling theAgentConfigInfo.setOvfPackageUrl()method.The EAM Sample Solution constructs the URLs to OVF files from information that you set in theeamri.propertiesfile.public AgentHandler([...]) { [...] _agentConfigInfo4x.setOvfPackageUrl(urlPrefix + ovfUrl4x); _agentConfigInfo50.setOvfPackageUrl(urlPrefix + ovfUrl50); [...] }
- Set the URLs to the optional VIB files from which the solution adds functions to the ESX Server by calling theAgentConfigInfo.setVibUrl()method.The EAM Sample Solution constructs the URLs to VIB files from information that you set in theeamri.propertiesfile.public AgentHandler([...]) { [...] _agentConfigInfo4x.setOvfPackageUrl(urlPrefix + ovfUrl4x); _agentConfigInfo50.setOvfPackageUrl(urlPrefix + ovfUrl50); if (deployVibs) { _agentConfigInfo4x.setVibUrl(urlPrefix + vibUrl4x); _agentConfigInfo50.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.The EAM Sample Solution sets some dummy properties in theeamri-webapp.xmlfile.public AgentHandler([...]) { [...] AgentOvfEnvironmentInfo ovfEnv = new AgentOvfEnvironmentInfo(); for (final Map.Entry<String, String> entry : ovfEnvironment.entrySet()) { ovfEnv.getOvfProperty().add(new AgentOvfEnvironmentInfoOvfProperty() { { setKey(entry.getKey()); setValue(entry.getValue()); } }); } _agentConfigInfo4x.setOvfEnvironment(ovfEnv); _agentConfigInfo50.setOvfEnvironment(ovfEnv); [...] }
- Create an instance ofAgencyConfigInfoto define the ESX agency that the solution deploys.public AgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); [...] }
- Provide names for the ESX agency and the ESX agents by calling theAgencyConfigInfo.setAgencyName()andsetAgentName()methods.The EAM Sample Solution names the ESX agency and the ESX agents Sample Service.public AgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); _agencyConfigInfo.setAgencyName("Sample Service"); _agencyConfigInfo.setAgentName("Sample Service"); [...] }
- Add an array of ESX agent configurations to the ESX agency configuration by calling theAgencyConfigInfo.getAgentConfig()method.public AgentHandler([...]) { [...] _agencyConfigInfo = new AgencyConfigInfo(); _agencyConfigInfo.setAgencyName("Sample Service"); _agencyConfigInfo.setAgentName("Sample Service"); _agencyConfigInfo.getAgentConfig().add(_agentConfigInfo4x); _agencyConfigInfo.getAgentConfig().add(_agentConfigInfo50); [...] }
- Set the scope of the ESX Agency by calling theAgencyConfigInfo.setScope()method.Users of the EAM Sample Solution set the scope of the ESX agency by selecting hosts from the EAM Sample Solution Configuration page. Consequently, the scope is empty until the EAM Sample Solution updates it according to the user interaction.public AgentHandler([...]) { [...] _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.