Hi Lukas,

Thanks for your reply and your kind offer of support. Reading your email, I understand there is a tie between actual inventory and group definition, but I would like to sort out of "bad it is".

Just to know how things works, let say, I brutally add the group definition either by hacking RHQ server code or by injecting them into the database (I did say "brutally" ;) ), what would happen ? Those groups definition will not appear in the RHQ GUI ? 

(Please, bear in mind that I have to use JON 2.4.2 (which I think is matching with RHQ 3.x), so maybe things are different there - probably worse)

On 13 December 2011 11:39, Lukas Krejci <lkrejci@redhat.com> wrote:
Hi Romain,

RHQ 4.1.0 and later already contains a start of an implementation that one day
I hope will support exporting group defs, alert defs and other useful data.
Please look at the SynchronizationManager in CLI and the design wiki page
http://wiki.rhq-
project.org/display/RHQ/Design+-+Configuration+synchronization.

As you can see the syncing capabilities are right now quite limited - we only
handle system settings and metric templates. The reason for that is that any
other useful type of data is either directly or indirectly tied to inventory.

For example for the group definitions import to be really useful, the members
of those groups should be reconstructed during import. Because the resources
in the target installation *are* going to differ (not only ID mismatch, but I
assume that for example installation directories and other criteria that could
be used to match the resources *are* going to differ between the different RHQ
installs), the export/import of groups is going to require some kind of mapper
or give up on group members and just create empty groups in the target RHQ
which the admin would then have to fill in manually. Note that a similar
complication applies to dyna-groups, which can be defined in a way that is not
transferable between installations.

If you look at all other entities - users, roles, alert definitions, you are
going to find ties to inventory which, in the end, are going to require the
above outlined inventory mapper. This is something we had to put aside when we
originally implemented the config sync because it'd require much more thought
and time than we had available for that. On the other hand, I think it is a
very desirable functionality and I'd love to help you out with anything you'd
need if you wanted to contribute.

On Tuesday, December 13, 2011 10:04:28 Romain Pelisse wrote:
> Hi all,
>
> I'm working a java tool to export RHQ configuration and import in a new
> instance - which should help migrating instance between version and/or
> databases. I managed to export group definition, by tricking a little bit
> the Remote API (2.4.2):
>
> resources =
> getResourceGroupManager().findResourceGroupsByCriteria(baseRemote.getSubjec
> t(), criteria);
> for ( ResourceGroup resource : resources ) {
> definitions.add(resource.getGroupDefinition());
> }
>
> However, I'm pretty much stuck right now, when it comes to importing those
> group. I've tried to "pass them along" with a dummy group definition...
>
> ResourceGroup resGroup = new ResourceGroup("dummy2");
> for ( GroupDefinition groupDefinition : groupDefinitions )
> resGroup.setGroupDefinition(groupDefinition);
>
> ... but it failed as Hibernate is complaining (rightfullly) that those
> entities are transient...
>
> Any proper way to do this ? Would it be difficult to change RHQ code to
> allow that ? If so, I'll be happy to be pointed to the right direction...
>
> Thanks a lot !
_______________________________________________
rhq-users mailing list
rhq-users@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/rhq-users



--
Romain PELISSE,
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it" -- Terry Pratchett
http://belaran.eu/wordpress/belaran