Delete an ESX
Agency
A solution can
delete an ESX agency by calling the
Agency.destroyAgency()
method on the
Agency
object.
- Verify that you have set up and started the EAM Sample Solution in an application server.
- Verify that you have openedin an editor.eam_work_folder\src\com\vmware\eam\sample\solution\AgentHandler.java
- Verify that you have openedin an editor.eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java
Typically, before deleting an
ESX agency, a solution firsts call the
EsxAgentManager.uninstall()
method to put the agency in the uninstalled state. The solution tracks the
progress of
EsxAgentManager.uninstall()
and only calls
destroyAgency()
to
remove the ESX agency when the status of the ESX agency is green.
If your solution does not need
to track the removal of the ESX agency and its ESX agents, you can call
destroyAgency()
without
first calling
uninstall()
. ESX Agent
Manager removes the ESX agency and all of the ESX agents without tracking the
status of the uninstallation process.
Alternatively, disconnecting
the solution from
by calling the
ExtensionManager.unregisterExtension()
method removes all ESX agencies and ESX agents.
The EAM Sample Solution does
not call the
Agency.destroyAgency()
method directly. The EAM Sample Solution calls the
Agency.disable()
and
Agency.uninstall()
methods to set the ESX agents in the uninstalled state, then calls
ExtensionManager.unregisterExtension()
to unregister the solution from
,
which removes the ESX agency and the ESX agents.
- Call theAgency.disable()method to disable the ESX agency.Calling theAgency.disable()method powers off the ESX agent virtual machines, but does not undeploy them.The EAM Sample Solution calls theAgency.disable()method in theAgentHandler.javaclass.public void disable() throws RuntimeFaultFaultMsg { waitForSetup(); _eamConnection.getStub().disable(_agency); }
- Call theAgency.uninstall()method to put the ESX agency in the uninstalled state.Calling theAgency.uninstall()method uninstalls all the ESX agents in the ESX agency.The EAM Sample Solution calls theAgency.uninstall()method in theAgentHandler.javaclass.public void uninstall() throws RuntimeFaultFaultMsg { waitForSetup(); _eamConnection.getStub().uninstall(_agency); }
- Delete the ESX agency and ESX agents.OptionDescriptionCall theAgency.destroyAgency()method on theAgencyobject.Deletes the agency and its ESX agents, but the solution remains registered withExtensionManager.Call theExtensionManager.unregisterExtension()method on theExtensionobject.Unregisters the solution from , which uninstalls the solution and deletes the ESX agency and its ESX agents.The EAM Sample Solution deletes the ESX agency by calling theExtensionManager.unregisterExtension()method in theManager.javaclass.public void cleanup() throws NotFoundFaultMsg, RuntimeFaultFaultMsg { if (_eamConnection != null) { _eamConnection.disconnect(); } _vimConnection.getStub().unregisterExtension(_vimConnection.getExtensionManager(), EXTENSION_KEY); }
You defined a function to
delete an ESX agency from a solution.