On Tuesday, December 13, 2011 11:52:15 Romain Pelisse wrote:
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)
If you agree to use brute-force database access then I think creating a well-
formed entry in the RHQ_GROUP_DEF table should do the trick. That said, I
don't know the dyna-groups (aka group definitions) implementation too well so
I might be wrong ;)
The group def should be picked up the next time the group memberships are
recalculated at which point the new groups based on the definition should be
normally created.
As you noticed, the group definition API is not exposed remotely at all (this
hasn't changed in RHQ 4, btw) so you're out of luck using CLI unless you'd be
willing to a) create a new remote interface that would mimick the currently
available local interface, b) add support for this new interface to the CLI.
These are not too complicated but a bit involved and would require recompiling
from source..
All that said, seeing that you are using JBoss ON, the best thing for you
would be to open a support ticket so that we can answer your question
rigorously.
On 13 December 2011 11:39, Lukas Krejci <lkrejci(a)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.getSubj
> ec
>
> > 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(a)lists.fedorahosted.org
>
https://fedorahosted.org/mailman/listinfo/rhq-users