Red Hat Bugzilla – Bug 674558
Detect deletion of resources that occur outside of RHQ
Last modified: 2011-05-23 20:52:23 EDT
Description of problem:
Today RHQ automatically imports into inventory services that are discovered. For example, the EAR and WAR files deployed to a managed EAP server are automatically imported into inventory. These resources are automatically imported even when they are deployed to the EAP server out of band, that is, outside of RHQ. If a WAR file is deleted out of band, RHQ will report it as having an availability of DOWN, but the resource is not automatically purged from inventory.
I think we are a bit inconsistent here in our approach. Here is something else to further my point. WAR and EAR files are content backed resources. There will be a resource in inventory that represents a managed WAR file. There is also at least one entry in the content subsystem for that WAR file. (There may be more entries in the content subsystem if different versions of the WAR file is deployed.) At some point after a WAR file is deleted out of band, content discovery runs on the agent, and it will be determined that the WAR has been deleted. After the content discovery report is sent up to the server and is processed, the WAR file is removed from the content subsystem.
We automatically import some child resource types. We automatically purge content for those resource types. We do not however automatically purge those resources. Where this becomes problematic is when I try to distinguish between a DOWN resource that still exists versus one that has been deleted out of band. As it stands right now, I do not see where RHQ offers a good way to make that determination.
Another solution other automatically purging resources, albeit less robust, could involve flagging the resource in some way to indicate that it may have been deleted out of band. This is probably less work that doing the automatic purge, but it is much less robust because it still requires the user to manually purge the resource.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
I mentioned that when a WAR/EAR file is deleted out of band, it is eventually and automatically purged from the content subsystem; however, this is only the case currently with the jboss-as plugin. The content is not automatically purged with the jboss-as-5 plugin due to bug 671496.