Add resource IDs as an attribute on ResourceGroup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Undecided
|
Jay Dobies |
Bug Description
The refs attribute on ResourceGroup returns a list of IDs for the created resources. But this isn't directly compatible with SoftwareDeploym
The current workaround is to make a template for a nested stack that outputs the ID using a get_resource call [2] and then get that value from the group's attributes[1].
This request is to add another attribute to ResourceGroup to retrieve the resource IDs as a map.
[1]
my_deployment
type: OS::Heat:
properties:
servers: { get_attr: [my_servers, attributes, server_id] }
[2]
resources:
server:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
outputs:
server_id:
description: Nova ID of the deployed server
value: { get_resource: server }
Changed in heat: | |
assignee: | nobody → Jay Dobies (jdob) |
Changed in heat: | |
status: | In Progress → Fix Released |
So, +1 on the general idea, but a couple of requests:
1. Can we please add the same attribute to AutoScalingGroup which suffers from the same problem IIRC
2. Can we please figure out a way (e.g via map_merge or repeat) to combine the maps of ID's from multiple resource groups, such that it's possible to do this:
group1: :ResourceGroup
type: OS::Heat:
properties:
count: {get_param: count_group1}
resource_def:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
group2: :ResourceGroup
type: OS::Heat:
properties:
count: {get_param: count_group2}
resource_def:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: flavor }
allnodes_ deployment_ group: :SoftwareDeploy mentGroup id_map_ attribute] } id_map_ attribute] }
type: OS::Heat:
properties:
servers:
<map_merge or repeat?>
- { get_attr: [group1, $resource_
- { get_attr: [group2, $resource_
Note we can't just use map_merge, because the keys will collide, so perhaps we can make repeat capable of generating maps, and iterating over each map adding a prefix related to the group name?