Change the Goal State of an Agency
A solution can
change the goal state of its ESX agencies while the solution is running. For
example, when a solution starts, the goal state of its ESX agencies can be
ENABLED
. If the solution includes a function to remove ESX
agencies, when this function runs, the goal state of the ESX agency changes to
UNDEPLOYED
.
You call the Agency.enable(), Agency.disable(), and Agency.uninstall() methods to change the goal state of an ESX agency. Calling these methods changes the status of the ESX agency to yellow until the agency reaches the desired state, in which case the status changes to green. If the ESX agency cannot achieve the goal state, the status changes to red.
The EAM Sample Solution defines a function to change the goal state of its ESX agencies in the AgentHandler.java class. The EAM Sample Solution changes the goal state of its ESX agency when users select ESXi hosts on which to run the solution, and when they uninstall the solution.
Prerequisites
-
Verify that you have set up and started the EAM Sample Solution in an application server.
-
Verify that you have opened eam_work_folder\src\com\vmware\eam\sample\solution\AgentHandler.java in an editor.
Procedure
Results
You changed the goal state of an ESX agency while the solution is running.