Bug 1011095

Summary: Give created resources the name supplied by the user even if the managed object has no "name" attribute
Product: [Other] RHQ Project Reporter: Thomas Segismont <tsegismo>
Component: Plugin ContainerAssignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: hrupp, loleary, rhatlapa
Target Milestone: ---   
Target Release: RHQ 4.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-23 12:30:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thomas Segismont 2013-09-23 15:29:56 UTC
This bug follows BZ886119 - "JON is using JNDI when referring to child Datasource resource instead of specified Resource name".

As a reminder, when a created resource is discovered, it is given a name by the agent plugin. If the underlying managed object has no "name" attribute, the agent plugin gives a name to the resource which is completely different than the user supplied name.

The proposal is to maintain a cache of the latest (10 minutes) resource creation requests (CreateResourceReport holds the user supplied name), and to lookup for an entry in this cache before sending the inventory report to the server, in order to update the newly discovered resource name, if needed.

Comment 1 Thomas Segismont 2013-10-21 09:16:21 UTC
Fixed in master

commit 7652569a57e633470fa325470533aa35769fbeda
Author: Thomas Segismont <tsegismo>
Date:   Thu Oct 17 12:32:36 2013 +0200
    
Made ResourceFactoryServerService#completeCreateResource synchronous
    
When merging inventory report, look for a CreateResourceHistory entity if merging a creatable resource.
If it exists, use the user supplied resource name.
    
Remove unused code in ResourceFactoryManagerBean
    
Added integration test

Comment 2 Thomas Segismont 2013-10-30 14:42:39 UTC
Additional commit in master

commit 3cee61d26c5151750a727502fd5c95c4bf715a18
Author: Thomas Segismont <tsegismo>
Date:   Wed Oct 30 15:34:28 2013 +0100

Revert "Bug 886119 - JON is using JNDI when referring to child Datasource resource instead of specified Resource name"

Comment 3 Heiko W. Rupp 2014-04-23 12:30:18 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.