Delete an ESX agency
A solution can delete an ESX agency by calling the
Agency.destroyAgency()
method on the Agency
object.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
vCenter Server
by calling the ExtensionManager.unregisterExtension()
method removes all ESX agencies and 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.Your solution can call theAgency.disable()method in theMyAgentHandler.javaclass.public void disable() throws RuntimeFaultFaultMsg { waitForSetup(); _myeamConnection.getStub().disable(_myagency); }
- 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.Your solution can call theAgency.uninstall()method in theMyAgentHandler.javaclass.public void uninstall() throws RuntimeFaultFaultMsg { waitForSetup(); _myeamConnection.getStub().uninstall(_myagency); }
- 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 fromvCenter Server, which uninstalls the solution and deletes the ESX agency and its ESX agents.Your solution can delete the ESX agency by calling theExtensionManager.unregisterExtension()method in theMyManager.javaclass.public void cleanup() throws NotFoundFaultMsg, RuntimeFaultFaultMsg { if (_myeamConnection != null) { _myeamConnection.disconnect(); } _myvimConnection.getStub().unregisterExtension(_myvimConnection.getExtensionManager(), EXTENSION_KEY); }
You defined a function to delete an ESX agency from a solution.