Dynamic Types

John Mazzitelli mazz at redhat.com
Thu Oct 21 20:45:52 UTC 2010


some background info that may or may not be relevent:

unlike resources, resource types are not synced with the server.

When the PC starts, it will sync its inventory with the server - 
essentially the server sends down all the information it knows about 
that agent's resources and the agent will reconcile that information 
(the server's information is authoritative - so if both the agent and 
server has information about a resource, the server's information "wins" 
and the agent will use the server data, throwing out whatever data it 
did have that conflicted with the server).

There is no syncing like that with types. The sync'ing is implicitly 
performed when the agent downloads/updates its plugins. The agent will 
guarantee that the PC gets the latest-n-greatest plugins. Because of 
this, when the PC starts up, all it needs to do is read the plugins' 
metadata and it knows it is synced with the server's metadata because 
the PC was told that the plugins it has has already been synced.

Now how is this related? Somehow, your dynamic metadata that is on the 
server needs to be sync'ed down to the agent - in the same way that 
resources are sync'ed today. How you would do that I dunno - but 
clearly, due to the fact that metadata is being created on the fly and 
stored on the server, there needs to be a way for the agent to download 
that metadata and reconcile it with whatever dynamic metadata the agent 
already has (maybe the agent persisted the metadata itself in the /data 
directory?).

On 10/21/2010 04:37 PM, Heiko W.Rupp wrote:
>
> Am 21.10.2010 um 22:31 schrieb Heiko W.Rupp:
>>
>> Is there an (easy) way to reconnect the resources to the type once the type got re-discovered as described above?
>
>
>
> Ah, I see near the end of org.rhq.core.pc.inventory.InventoryManager#mergeResource
>              resource.setResourceType(fullResourceType);
>
>              resourceContainer = initResourceContainer(resource);
> ...
>          refreshResourceComponentState(resourceContainer, pluginConfigUpdated);
>
> I guess this would mean to find the resource without type once the type is known
> again and run those above lines. Or is there a better idea? Especially as it looks like
> the information about that resource is lost when the first merge fails
>
>      Heiko
>


More information about the rhq-devel mailing list