Bug 577055

Summary: add support to metadata update code for moving a ResourceType to a different parent
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: Core ServerAssignee: Ian Springer <ian.springer>
Status: CLOSED CURRENTRELEASE QA Contact: Sudhir D <sdharane>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.3.1CC: ccrouch, rtimaniy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:45:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 591531    

Description Ian Springer 2010-03-25 23:35:40 UTC
It looks like Heiko started adding support for this but never got it working. The @Test annotation on the method:

   UpdateResourceTypeSubsystemTest.testMoveResoureType()
 
was commented out. I tried uncommenting it and running the test but it failed.

Comment 1 Ian Springer 2010-03-25 23:39:36 UTC
Note: This is something we'd like to have so we can move the as5 plugin's JBoss Messaging Topic and Queue restypes under a new JBoss Messaging Container singleton restype, rather than directly under the JBossAS Server restype, so the admin console will be able to not render JBoss Messaging restype nodes in its navtree when HornetQ is the JMS impl.

Comment 2 Ian Springer 2010-05-19 17:14:58 UTC
Here's the EmbJopr/admin-console issue for the moving of the as5 plugin Topic/Queue types: https://jira.jboss.org/browse/EMBJOPR-303

Comment 3 Ian Springer 2010-05-20 14:41:12 UTC
See also: https://bugzilla.redhat.com/show_bug.cgi?id=534274

Comment 4 Ian Springer 2010-05-24 15:31:56 UTC
This is done and is encompassed by the following commits:

http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=2e1a8be116717c33c91114cb0dd9ac9f254acf10
http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=10d7bf099a310e9be9d93637299d67265e29aa2f
http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=b71faa29cafc4e4737184f7b8a348091748bd29f
http://git.fedorahosted.org/git?p=rhq/rhq.git;a=commit;h=1fe024068b6aaa61068382cf3cbc099a638e3200

The first one is the main commit. 

We now support moving a ResourceType to a new parent which is an ancestor or a descendant of its current parent. Any existing Resources of the type that was moved are also moved to the corresponding location in the Resource hierarchy.

UpdateResourceTypeSubsystemTest.testMoveResoureType() has been updated and enabled to test the new functionality.

Comment 5 Charles Crouch 2010-05-24 19:13:44 UTC
Ian
We need test steps here, i.e. what to see in 2.3.1 and what to see 2.4, also is it worth create metrics/operations/config changes against resources of the types which are moving?

Comment 6 Ian Springer 2010-05-24 20:20:27 UTC
TEST STEPS
==========
1) Install JON 2.3.1. 
2) Start up a JBoss EAP 5.0 Server with at least one JBoss Messaging topic and queue deployed.
3) Discover and import the EAP server into inventory. Make sure the topic and queue are discovered as child Resources of the JBoss AS Server resource, and make sure all three resources are up.
4) Note the Resource id's of the topic and queue Resources.
5) On the queue Resource:
  a) change its Resource name to "foo Queue" 
  b) make it a favorite
  c) change one of its metric schedules
  d) create a "foo" alert
6) Upgrade the JON Server to JON 2.4. After the Agent on the EAP 5.0 box has been auto-upgraded, run the "plugins info" command to make sure its plugins have been updated to v2.4. If not, run the "plugins update" Agent prompt command to update them.
7) Run the "discovery -f" Agent prompt command. Wait a minute or two and verify that in the GUI there is now a new "JBoss Messaging" resource as a child of the JBoss AS Server resource, that it is green, and that it has the topic and queue Resources as children.
8) Verify that, despite their new locations in the Resource hierarchy, the topic and queue Resources have the same resource id's that were noted in step 4, are still green, and the changes made to the queue Resource in step 5 are all still evident.

Comment 7 Rajan Timaniya 2010-06-14 07:43:13 UTC
Verified on JON build# 210
(http://hudson-qe.rhq.rdu.redhat.com:8080/view/JON/job/jon/210/)

Verified with the above (Comment-6) steps, despite their new locations in the Resource hierarchy, the topic and queue Resources have the same resource id's that were noted in step 4, are still green, and the changes made to the queue Resource in step 5 are all still evident.

Comment 8 Corey Welton 2010-08-12 16:45:22 UTC
Mass-closure of verified bugs against JON.