heat template fetches wrong ID's by name

Bug #1607315 reported by Mika Oksanen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Won't Fix
Medium
Peter Razumovsky
9.x
Won't Fix
Medium
Peter Razumovsky

Bug Description

Hi,
I'm checking that our templates work also in Mitaka 9.0 and I noticed that when subnet template is using network name as a reference then it fails to find its parent network.

simplified example:
net.yaml
heat_template_version: 2015-04-30
resources:
  media_net:
    type: OS::Neutron::Net
    properties:
      name: media_net
  signaling_net:
    type: OS::Neutron::Net
    properties:
      name: signaling_net

subnet.yaml
heat_template_version: 2015-04-30
resources:
  signaling_subnet:
    type: OS::Neutron::Subnet
    properties:
      name: signaling_subnet
      cidr: 10.0.0.0/24
      network: signaling_net
      gateway_ip: 10.0.0.1
      allocation_pools:
        - start: 10.0.0.2
          end: 10.0.0.100
  media_subnet:
    type: OS::Neutron::Subnet
    properties:
      name: media_subnet
      cidr: 10.1.0.0/24
      network: media_net
      gateway_ip: 10.1.0.1
      allocation_pools:
        - start: 10.1.0.2
          end: 10.1.0.100

steps to reproduce:
heat stack-create net -f net.yaml --poll
heat stack-create subnet -f subnet.yaml --poll;openstack network list

For some reason the stacks are created fine for the first time but when you delete the stacks and create them again the failure happens.

Error msg:
| stack_status | CREATE_FAILED |
| stack_status_reason | Resource CREATE failed: NetworkNotFoundClient: |
| | resources.media_subnet: Network 76561dc7-9dd2-4acc- |
| | aeb7-f0692432b8bf could not be found. Neutron server |
| | returns request_ids: ['req-2b708052-aa8e- |
| | 4aee-8358-9b3f358a95ad'] |

Note ! the Network 76561dc7... existed on previous round (stack-create, stack-delete)

45424a2cb90ee9e68cac9136 - - -] create failed (client error): Network 76561dc7-9dd2-4acc-aeb7-f0692432b8bf could not be found.
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource Traceback (most recent call last):
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 709, in _action_recorder
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource yield
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 780, in _do_action
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/scheduler.py", line 311, in wrapper
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource step = next(subtask)
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 751, in action_handler_task
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource handler_data = handler(*args)
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resources/openstack/neutron/subnet.py", line 361, in handle_create
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource subnet = self.client().create_subnet({'subnet': props})['subnet']
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 97, in with_params
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource ret = self.function(instance, *args, **kwargs)
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 707, in create_subnet
2016-07-28 10:23:40.412 97231 ERROR heat.engine.resource return self.post(self.subnets_pa

Changed in mos:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → MOS Heat (mos-heat)
milestone: none → 9.1
Revision history for this message
Oleksii Chuprykov (ochuprykov) wrote :

It seems that the problem in turned on cache. Heat get the value for specific name from cache, instead of neutron.

tags: added: customer-found
tags: added: 9.0-updates for sla1
tags: removed: 9.0-updates for sla1
Changed in mos:
assignee: MOS Heat (mos-heat) → Peter Razumovsky (prazumovsky)
Revision history for this message
Peter Razumovsky (prazumovsky) wrote :

The initial fix patch on review https://review.openstack.org/#/c/362406/. This week (Aug 31 - Sep 4) duvarenkov (Dmitriy Uvarenkov) is responsible for the issue.

Revision history for this message
Peter Razumovsky (prazumovsky) wrote :

Currently fix is developing by ochuprykov with duvarenkov support - they have an different idea than presented in patch above. Let's wait until they commit it.

Revision history for this message
Dmitriy (duvarenkov) wrote :

Patch, fixing this issue is proposed in master - https://review.openstack.org/#/c/366696/

Changed in mos:
assignee: Peter Razumovsky (prazumovsky) → Dmitriy (duvarenkov)
Revision history for this message
Oleksii Chuprykov (ochuprykov) wrote :

It affects only resource finder cache, i.e. cache that we use for translation rules. There is simple workaround - turn off this particular cache. Put this lines in you heat.conf:

[resource_finder_cache]
caching = False

This will turn off only resource finder cache, other caching, for example, caching for constraints validation will continue working, so this won't decrease performance dramatically.

Changed in mos:
milestone: 9.1 → 9.2
Changed in mos:
importance: High → Medium
Changed in mos:
assignee: Dmitriy (duvarenkov) → Peter Razumovsky (prazumovsky)
Revision history for this message
Oleksiy Molchanov (omolchanov) wrote :

Won't fix because of misconfiguration described here - https://review.openstack.org/#/c/366696/

Changed in mos:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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