Bug 570839 - Provide ability to make the name of imported tomcat instances unique
Provide ability to make the name of imported tomcat instances unique
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
All All
low Severity high (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Sunil Kondkar
: FutureFeature, Improvement
Depends On:
Blocks: jon24-naming jon30-bugs
  Show dependency treegraph
Reported: 2010-03-05 10:27 EST by Lami Akagwu
Modified: 2013-09-02 03:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-02 03:15:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
enable remote update of a resource (4.75 KB, patch)
2010-03-05 11:36 EST, Lukas Krejci
no flags Details | Diff
screenshot (176.18 KB, image/png)
2010-10-25 03:20 EDT, Rajan Timaniya
no flags Details
Screenshot_cli (123.19 KB, image/png)
2010-11-30 06:53 EST, Sunil Kondkar
no flags Details

  None (edit)
Description Lami Akagwu 2010-03-05 10:27:01 EST
Description of problem:
In its current form, when you import multiple tomcat instances, there is no mechanism for distinguishing between the instances.
Each of the instance name typically appears as Tomcat(Port).
If all the ports are 8080, then there no way of telling which tomcat instance you are looking at.
While it may be possible to rename the resource name via the UI, it is not a viable solutions where you have several dozen resources or if you have to uninventory the resource and reimport.

Version-Release number of selected component (if applicable):
JON 2.3.x

How reproducible:

Steps to Reproduce:
1. startup import multiple instances of tomcat where the port numbers are all 8080
2. import the resource via the JON GUI and the names of the resources appears as
.. ..

Additional info:
Possible implementation options

1. A configurable System parameter which can be read and appended to each instance to make the resource name unique e.g -DtomcatResourceIdentifier=Europe-zone-1-
2. Provide  mechanism by which the resource name can be auto updated via the CLI; passing a parameter that should be appended to or replace the existing resource name
Comment 1 Lukas Krejci 2010-03-05 11:36:57 EST
Created attachment 398076 [details]
enable remote update of a resource

Incidentally, progress is being made on the resource naming and presentation already.

In the next major version, the UI will be updated to present any kind of resource list (be it a search result or for example group membership list) in such a way that possible duplicate names will be resolved by specifying the parent path up to a point where it differs.

So in your reproduction steps, you won't see:
.. ..

but rather:
Tomcat(8080)   Platform1
Tomcat(8080)   Platform2
.. ..
Tomcat(8080)   PlatformN

As for the implementation options, I think the option 2. is a very useful extension. I am including a patch to add an ability for the CLI to update the resource remotely. 

For the sake of data consistency only the properties editable in the "General Properties" section in the UI are editable remotely using CLI (i.e. only the name, description and location of a resource).
Comment 2 Charles Crouch 2010-07-27 09:18:23 EDT
Someone looking for resource name changing ability
Comment 3 Charles Crouch 2010-08-05 00:12:04 EDT
Lets go ahead and apply this patch, *and* add tests that its works and has the appropriate security on it.
Comment 4 Lukas Krejci 2010-08-16 08:34:44 EDT
This functionality seems to have been added while addressing a separate issue by commit 38aa7252752eb905b84127662e0149f6d470ba7b.
Comment 5 Rajan Timaniya 2010-10-25 03:19:44 EDT
Tested on RHQ-Master build #500

1) Installed RHQ server and 2 agents
2) Both agent has Tomcat 5.5 running on port 8899
3) Import all resource in RHQ server

Tomcat server name shows as given below:
Tomcat (8899)    Platform-1
Tomcat (8899)    Platform-2

Tomcat server name can change from 'Summary' -> 'Overview' tab.
Comment 6 Rajan Timaniya 2010-10-25 03:20:27 EDT
Created attachment 455409 [details]
Comment 7 Rajan Timaniya 2010-10-28 06:57:09 EDT
Hi Lukas, 

Require steps to test using CLI and what should be expected. Are tomcat servers discover with unique name or it will be fine if user can rename using UI or CLI?
Comment 8 Lukas Krejci 2010-11-10 09:53:42 EST
Steps for CLI:

1) start up the cli using 


and do the following steps on in the CLI interface.
2) login rhqadmin rhqadmin localhost 7080
3) var r = ResourceManager.getResource(10001)
4) r.name = "updated"
5) ResourceManager.updateResource(r)
6) var r2 = ResourceManager.getResource(10001)
7) pretty.print(r2)

The result of the last statement should print the details of the resource with id 10001 which should have its name set to "updated".
Comment 9 Sunil Kondkar 2010-11-30 06:52:06 EST
Verified on rhq-server-4.0.0-SNAPSHOT build#725.

Started the CLI and followed the steps as below:

rhqadmin@$ var r = ResourceManager.getResource(11794)

rhqadmin@$ r.name = "updated"

rhqadmin@$ ResourceManager.updateResource(r)
                         id: 11794
                       name: updated
        currentAvailability: UP
               resourceType: Tomcat Server

rhqadmin@$ var r2 = ResourceManager.getResource(11794)

rhqadmin@$ pretty.print(r2)
                         id: 11794
                       name: updated
        currentAvailability: UP
               resourceType: Tomcat Server

This replaced the existing tomcat resource name to 'updated' as shown in attached screenshot.
Comment 10 Sunil Kondkar 2010-11-30 06:53:33 EST
Created attachment 463703 [details]
Comment 11 Heiko W. Rupp 2013-09-02 03:15:41 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

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