Update stack return empty values value for Template Resource after Check Stack

Bug #1534242 reported by Guy Paz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
New
Undecided
Unassigned

Bug Description

We are seeing some bad behavior of Heat Stack Check->Update .
If user do Check Stack he will lost all Outputs params for Resource Type (Template Resource)

For example (Hot Templates attached) , we have Resource B that get some param from Resource A and I m doing Check Stack and then Update Stack – Resource B need to get the param from Resource A and now this param is null/empty,
So stack update will use empty value and will fail !

I able to create very simple Heat Template that reproduce this problem.
Resource B getting the IP from resource A and create a VM with this name.

To reproduce:
Scenario 1:
- Create the stack (you can see that B vm name created with the output IP from A)
- Execute 'Check Stack'(at this point you will see that output value for A is - empty: Horizon-> Resourse A -> Overview -> Outputs)
- Update stack with the original template.
- Update Failed

Scenario 2:
- Create the stack
- Remove VM B (that has name IP from A)
- Execute 'Check Stack' (at this point you will see that output from A is empty)
- Update stack with the original template.
- You will see that B will not get the IP/Name from A like it was when we deploy the stack.

My expectation is that B will created with the same values (name in this case) like he had in 'create'.

NOTE that If I ll do only check and then update we are getting update failed since now name is null:
"resources.resource_B: BadRequest: resources.server: Server name has a minimum character requirement of 1. (HTTP 400) (Request-ID: req-3950e5c0-c04f-4292-b93f-b3b9d24a5a36)"

and this is the exception:
 log_http_response /usr/lib/python2.7/site-packages/glanceclient/common/http.py:136
2016-01-14 20:06:16.255 17722 INFO heat.engine.resource [-] UPDATE: Server "server" [b324dac9-6abd-4795-9f4a-b53de09943f1] Stack "test8-resource_B-sa6xqkai65pq" [1b81f309-d8ac-4acb-9583-f9b6dbfe64e3]
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource Traceback (most recent call last):
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 543, in _action_recorder
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource yield
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 811, in update
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource args=[after, tmpl_diff, prop_diff])
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 296, in wrapper
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource step = next(subtask)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 584, in action_handler_task
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource handler_data = handler(*args)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resources/openstack/nova/server.py", line 1115, in handle_update
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource self.client_plugin().rename(server, prop_diff[self.NAME])
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/clients/os/nova.py", line 348, in rename
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource server.update(name)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v2/servers.py", line 55, in update
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource self.manager.update(self, name=name)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v2/servers.py", line 918, in update
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource return self._update("/servers/%s" % base.getid(server), body, "server")
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 174, in _update
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource _resp, body = self.api.client.put(url, body=body)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 456, in put
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource return self._cs_request(url, 'PUT', **kwargs)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 428, in _cs_request
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource resp, body = self._time_request(url, method, **kwargs)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 397, in _time_request
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource resp, body = self.request(url, method, **kwargs)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 391, in request
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource BadRequest: Server name has a minimum character requirement of 1. (HTTP 400) (Request-ID: req-3950e5c0-c04f-4292-b93f-b3b9d24a5a36)
2016-01-14 20:06:16.255 17722 TRACE heat.engine.resource
2016-01-14 20:06:16.261 17722 DEBUG heat.engine.scheduler [-] Task update_task from Stack "test8" [1e3411a3-7e6d-4ba9-99e2-055faa394b82] running step /usr/lib/python2.7/site-packages/heat/engine/scheduler.py:220
2016-01-14 20:06:16.262 17722 DEBUG heat.engine.scheduler [-] Task Stack "test8" [1e3411a3-7e6d-4ba9-99e2-055faa394b82] Update running step /usr/lib/python2.7/site-packages/heat/engine/scheduler.py:220

Revision history for this message
Guy Paz (guy-paz) wrote :
description: updated
Guy Paz (guy-paz)
description: updated
description: updated
Guy Paz (guy-paz)
summary: - Check stack remove output params value for Template Resource
+ Update stack return empty values value for Template Resource after Check
+ Stack
description: updated
Guy Paz (guy-paz)
description: updated
description: updated
Revision history for this message
Thomas Herve (therve) wrote :

To confirm, the problem is on Kilo, correct?

Revision history for this message
Guy Paz (guy-paz) wrote :

It is in Kilo.
solved in Mitaka (I test it yesterday).
Maybe it was a bug that solved already on Liberty/Mitaka ..

I m trying to check on Liberty (having some issues with my Devstack).
when I switched Liberty I m getting : "Could not load heat_template_version.2016-04-08: 'module' object has no attribute 'HOTemplate20160408'"

Revision history for this message
Thomas Herve (therve) wrote :

I suspect it's a duplicate of https://bugs.launchpad.net/heat/+bug/1505054

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.