[openstack-dev] [Heat] Passing a list of ResourceGroup's attributes back to its members

Zane Bitter zbitter at redhat.com
Thu Aug 7 22:53:31 UTC 2014


On 07/08/14 13:22, Tomas Sedovic wrote:
> Hi all,
>
> I have a ResourceGroup which wraps a custom resource defined in another
> template:
>
>      servers:
>        type: OS::Heat::ResourceGroup
>        properties:
>          count: 10
>          resource_def:
>            type: my_custom_server
>            properties:
>              prop_1: "..."
>              prop_2: "..."
>              ...
>
> And a corresponding provider template and environment file.
>
> Now I can get say the list of IP addresses or any custom value of each
> server from the ResourceGroup by using `{get_attr: [servers,
> ip_address]}` and outputs defined in the provider template.
>
> But I can't figure out how to pass that list back to each server in the
> group.
>
> This is something we use in TripleO for things like building a MySQL
> cluster, where each node in the cluster (the ResourceGroup) needs the
> addresses of all the other nodes.

Yeah, this is kind of the perpetual problem with clusters. I've been 
hoping that DNSaaS will show up in OpenStack soon and that that will be 
a way to fix this issue.

The other option is to have the cluster members discover each other 
somehow (mDNS?), but people seem loath to do that.

> Right now, we have the servers ungrouped in the top-level template so we
> can build this list manually. But if we move to ResourceGroups (or any
> other scaling mechanism, I think), this is no longer possible.

So I believe the current solution is to abuse a Launch Config resource 
as a store for the data, and then later retrieve it somehow? Possibly 
you could do something along similar lines, but it's unclear how the 
'later retrieval' part would work... presumably it would have to involve 
something outside of Heat closing the loop :(

> We can't pass the list to ResourceGroup's `resource_def` section because
> that causes a circular dependency.
>
> And I'm not aware of a way to attach a SoftwareConfig to a
> ResourceGroup. SoftwareDeployment only allows attaching a config to a
> single server.

Yeah, and that would be a tricky thing to implement well, because a 
resource group may not be a group of servers (but in many cases it may 
be a group of nested stacks that each contain one or more servers, and 
you'd want to be able to handle that too).

> Is there a way to do this that I'm missing? And if there isn't, is this
> something we could add to Heat? E.g. extending a SoftwareDeployment to
> accept ResourceGroups or adding another resource for that purpose.
>
> Thanks,
> Tomas
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>




More information about the OpenStack-dev mailing list