Service discovery is never executed for a server manually added under another server. To be more precise, RuntimeDiscoveryExecutor.discoverForResource(..) is executed for the nested server just once right after it is added but it returns immediately since the parent server is not in the COMMITTED state yet. Further, when common platform resource discovery is triggered, RuntimeDiscoveryExecutor iterates trough all platform's servers, calls discoverForResource on them and on their newly found sub-components, while previously manually added server is left behind.
if this is still an issue today, it should get high priority. we don't want to give people headaches just because we weren't able to auto-discover there resource.
With QA to try to reproduce
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1006
Moved to ON_QA with the expectation that this is resolved. if it is not, please reopen. Otherwise close.
this is still a problem. verified on latest 4.0 beta1. get a plugin with four levels deep of resources and you'll see it (top server, direct child, grandchild, great-grandchild). workaround - use "discovery --resourceId" feature to force the discovery.
Created attachment 485634 [details] skeleton plugin to test with attaching a skeleton plugin jar with source that can test this. the plugin jar does nothing except attempt to build the following hierarchy: + My Top Server ++ My Child +++ My GrandChild 1 ++++ My GreatGrandChild 1 ++++ My GreatGrandChild 2 +++ My GrandChild 2 ++++ My GreatGrandChild 1 ++++ My GreatGrandChild 2 Note that you must manually add the "My Child" resource after My Top Server is auto-discovered. The grandchild and greatgrandchild services are autodiscovered. My Top Server is a server, the others are services. Notice the 4-level deep hierachy. I think this is required to test this issue. Because after manually importing My Child, a service scan discovery will find the My GrandChild 1/2 services. However, its the 4th level deep - the great grand child services, that cannot be auto-discovered. You have to use the "discovery --resourceId" mechanism to force those services to be found.
Created attachment 485833 [details] patch to fix the issue
I think this is finally fixed. commit 8a4b075dbb23c09759ea64db09346e6f80bd7328 To test: 1) deploy the attached plugin to your RHQ Server 2) update your agent's plugins to pick up the new plugin and wait for the new Top Server to be autodiscovered and placed into your auto-discovery queue 3) import Top Server 4) go to Top Server and manually add a "Child" resource 5) refresh the browser window after a while (60 seconds or so?) and see that you have a hierarchy under Top Server that is described in comment #7
Verified on build123 (Version: 4.1.0-SNAPSHOT Build Number: a6d2d56) Deployed and imported the attached skeleton plugin. Navigated to the inventory tab of the top server and imported child resource. The hierarchy under Top Server is displayed. Please refer the attached screenshot. Marking as verified.
Created attachment 503857 [details] Screenshot
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.