Bug 849711 - (PM-333, PRODMGT-333) [Feature] Need a simple method to remove agent from RHQ server
[Feature] Need a simple method to remove agent from RHQ server
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Inventory (Show other bugs)
JON 3.1.2
All All
high Severity urgent
: ER01
: JON 3.2.0
Assigned To: John Mazzitelli
Mike Foley
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-20 12:33 EDT by Larry O'Leary
Modified: 2014-01-02 15:39 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Feature Request
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
screenshot of the warning that pops up when asking to delete agents (55.11 KB, image/png)
2013-04-17 16:15 EDT, John Mazzitelli
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker PRODMGT-333 Major Closed Add simple method of managing/removing agent registrations from the JON server 2016-07-13 19:41 EDT

  None (edit)
Description Larry O'Leary 2012-08-20 12:33:55 EDT
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):
4.4

How reproducible:
Always

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.
  
Actual results:
Agent remains in a DOWN state in the RHQ agent topology page
Discovery queue continues to show discovered resources

Expected results:
A server side method should be invoked to remove the agent along with its inventory that is being displayed in the discovery queue.
Comment 1 Larry O'Leary 2012-08-20 12:39:02 EDT
Bug 535246 was supposed to address this but it does not address the issue pertaining to uncommitted inventory from the agent.
Comment 2 Charles Crouch 2013-02-11 16:28:31 EST
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.
Comment 3 Charles Crouch 2013-03-07 23:44:56 EST
Moving RFE to JON product bugzilla
Comment 4 Charles Crouch 2013-03-07 23:51:29 EST
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
or
ii) delete all vestiges of the agent from the discovery queue and anywhere else, assuming its not yet been imported.
Comment 6 John Mazzitelli 2013-03-13 10:16:48 EDT
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.
Comment 7 John Mazzitelli 2013-03-13 10:18:36 EDT
(In reply to comment #6)
> git commit to master: 

opps, forgot to put in the actual hash - git commit to master:

c9287f6c75b16712c45f03d24ea363524921ae39
Comment 8 John Mazzitelli 2013-04-17 16:15:00 EDT
Created attachment 737002 [details]
screenshot of the warning that pops up when asking to delete agents

I documented this feature on my blog here:

http://management-platform.blogspot.com/2013/03/deleting-rhq-agent-made-easier.html

(the attached screenshot is also in that blog)
Comment 9 Charles Crouch 2013-04-17 16:34:09 EDT
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?
Comment 10 John Mazzitelli 2013-04-17 16:50:48 EDT
git commit to master: 1e284420cfc176787040cd562f6bfa40a13cf257

Messages.properties change:

-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?
Comment 11 Larry O'Leary 2013-04-17 17:12:01 EDT
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).
Comment 12 Mike Foley 2013-09-04 16:51:03 EDT
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.
Comment 13 Mike Foley 2013-09-04 17:01:54 EDT
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.
Comment 14 Mike Foley 2013-09-04 17:03:09 EDT
Discussed with Mazz.  Agreed there is no need for a developer demo.  

QE to test as follows:
1)  http://management-platform.blogspot.com/2013/03/deleting-rhq-agent-made-easier.html
2)  its just navigating to Admin>Agents, selecting an agent, and clicking the "delete" button :)
Comment 15 Mike Foley 2013-09-05 15:08:15 EDT
this is still open.

QE work will be tracked here ...

https://engineering.redhat.com/trac/jon/ticket/673

Note You need to log in before you can comment on or make changes to this bug.