stack-delete fails when deleting a template with resource group

Bug #1547435 reported by jz
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Heat

Bug Description

using the below template created a stack. but delete will fail

heat_template_version: 2015-04-30

description: Simple template to deploy 100 compute instances

    type: string
    type: number
    default: 2

      type: OS::Neutron::Net
         admin_state_up: true
      type: OS::Neutron::Subnet
         enable_dhcp: true
         network_id: { get_resource: net }
         - start:

    type: OS::Heat::ResourceGroup
      count: { get_param: instance_count }
        type: OS::Nova::Server
          image: { get_param: image_name }
          flavor: { get_param: flavor_name }
             - 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-e651-4f9e-a205-3756999de58a. One or more ports have an IP allocation from this subnet"

Changed in heat:
assignee: nobody → zhaozhilong (zhaozhilong)
Revision history for this message
Rabi Mishra (rabi) wrote :

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.


    type: OS::Heat::ResourceGroup
    depends_on: subnet


             - 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.


Revision history for this message
jz (danielradcliffe2004) wrote :

I know add depends_on is a work around and has tried that already. But I think even
without depends_on, heat should handle the dependency correctly in this case.

Revision history for this message
tom king (kingttx) wrote :

This also affects VIO 3.1.

Revision history for this message
Rabi Mishra (rabi) wrote :

We probably don't have a way to handle this atm. You can surely use the workaround in comment #1.

Changed in heat:
milestone: none → next
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.