Hi Lukas,
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