Red Hat Bugzilla – Bug 849711
[Feature] Need a simple method to remove agent from RHQ server
Last modified: 2014-01-02 15:39:35 EST
Description of problem:
When an agent is no longer installed or needs to be removed from the RHQ server the user currently has to import the agent's platform into inventory and then remove the platform from inventory to remove the agent's registration/association with the server.
Instead, a button or other feature should be added that will allow a user to de-register and remove the agent's inventory from the agent topology page. Essentially, the feature would remove the agent, the agent's security token, and all the agent's inventory (COMMITTED and/or NEW). Obviously, usage of the feature should warn the user that it can not be undone and that all associated inventory will be lost.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start an agent and register it with the RHQ server
2. Wait for the agent to perform its discovery
3. Shutdown the agent and delete the installation as if the agent shouldn't never have been installed.
Agent remains in a DOWN state in the RHQ agent topology page
Discovery queue continues to show discovered resources
A server side method should be invoked to remove the agent along with its inventory that is being displayed in the discovery queue.
Bug 535246 was supposed to address this but it does not address the issue pertaining to uncommitted inventory from the agent.
Talking to Larry a bit more on this:
-If we ignore the discovery queue for a moment, this request is essentially the same as removing the platform from inventory: since this will remove all resources associated with the agent and also remove the row from the rhq-agent table.
-The problem is mostly for platforms/agents which are only in the discovery queue. You can't remove something from the db via the discovery queue. Instead you have to import it into the inventory and then remove it. So this RFE is really about removing the need for this workaround.
-There is a theoretical problem that someone could register an agent and then cancel it before the agent has a chance to send up its inventory report. So there would be a row in rhq-agent but nothing in the discovery queue. I don't know if this is actually feasible but would be nice if we handle this issue too.
In terms of solutions I'm kind of liking Larry's suggestion more of getting rid of the discovery queue entirely and just have all resources (including those not yet imported) in the inventory list (perhaps unclickable). From there they could be imported or deleted as necessary.
Moving RFE to JON product bugzilla
In the cold light of day I think dropping the entire discovery queue is probably a little overkill for this RFE, though I think it would make an interesting RFE on its own.
The simplest option as mentioned in the original PRODMGT issue seems to be add a Delete button (and warning) to the topology pages. That will either
i) delete the platform from inventory, if its there
ii) delete all vestiges of the agent from the discovery queue and anywhere else, assuming its not yet been imported.
git commit to master:
there is now a "delete" button on the Administration>Agents page. Select one or more agents, press the "delete" button and the agent's platform and child resources are uninventoried and the agent row in the RHQ_AGENT table is deleted. Once you click delete and the server does its thing, the UI page will refresh and the agents should no longer show up in the list.
If the agent is still running, then within a short time you may see the agent come back again and its new discovered inventory show up in the discovery queue.
(In reply to comment #6)
> git commit to master:
opps, forgot to put in the actual hash - git commit to master:
Created attachment 737002 [details]
screenshot of the warning that pops up when asking to delete agents
I documented this feature on my blog here:
(the attached screenshot is also in that blog)
I think the text of the warning popup should be stronger. It should read
"This will deregister the selected agents and uninventory their corresponding platforms and all other resources associated with them. There is no way to undo this action. Are you sure you want to do this?
git commit to master: 1e284420cfc176787040cd562f6bfa40a13cf257
-view_adminTopology_agent_delete_confirm = This will delete the selected agents and uninventory any and all resources associated with them. Are you sure you want to do this?
+view_adminTopology_agent_delete_confirm = This will deregister the selected agents and uninventory their corresponding platforms and all other resources associated with them. There is no way to undo this action. Are you sure you want to do this?
Thanks mazz. Looks good. Of course seeing two words that don't actually exist in the dictionary in a message worries me but I am no grammar expert (deregister vs. uninentory).
Exit criteria for RFEs is a development demo to QE and GSS. The demo is critical in initiating a converstion that leads to structured testcase development.
Assigning back to development until a developer demo is done.
Discussed with Mazz. Agreed there is no need for a developer demo.
QE to test as follows:
2) its just navigating to Admin>Agents, selecting an agent, and clicking the "delete" button :)
this is still open.
QE work will be tracked here ...