[openstack-dev] [Heat] Passing a list of ResourceGroup's attributes back to its members
Tomas Sedovic
tsedovic at redhat.com
Thu Aug 7 17:22:22 UTC 2014
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.
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.
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.
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
More information about the OpenStack-dev
mailing list