stack-delete fails when deleting a template with resource group
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
New
|
Undecided
|
zhaozhilong |
Bug Description
using the below template created a stack. but delete will fail
heat_template_
description: Simple template to deploy 100 compute instances
parameters:
image_name:
type: string
instance_count:
type: number
default: 2
resources:
net:
type: OS::Neutron::Net
properties:
subnet:
type: OS::Neutron::Subnet
properties:
cidr: 10.0.0.0/24
- start: 10.0.0.1
end: 10.0.0.10
instances:
type: OS::Heat:
properties:
count: { get_param: instance_count }
resource_def:
type: OS::Nova::Server
properties:
image: { get_param: image_name }
flavor: { get_param: flavor_name }
networks:
- network: { get_resource: net }
when deleting the stack, it seemed that heat did not calclulate the dependencies correctly, and tried
to delete the subnet first which led to a conflict:
"Conflict: Unable to complete operation on subnet bb7a7d76-
Changed in heat: | |
assignee: | nobody → zhaozhilong (zhaozhilong) |
I think you can get around this issue by adding explicit dependency 'depends-on' to 'instances' or use the subnet with the server networks property.
ex.
instances: :ResourceGroup
type: OS::Heat:
depends_on: subnet
or
networks:
- subnet: { get_resource: subnet }
There is check for the OS::Nova::Server to check for subnets[1] in the same stack. However, it does not work with ResourceGroup as it's nested stack and the subnet is in the parent/root stack.
However, the template you used results in a non deletable stack which is worrying.
[1] https:/ /github. com/openstack/ heat/blob/ master/ heat/engine/ resources/ openstack/ nova/server. py#L987- L998