can't list outputs when stack create failed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Victor HU |
Bug Description
I'm trying to create a stack with software deployed on the vm. The template is like:
heat_template_
resources:
testconfig:
type: OS::Heat:
properties:
group: script
config: |
#!/bin/sh
#...... do sth ......
service xxxx restart #this line will cause an error
testdeploy:
type: OS::Heat:
properties:
server: {get_resource: testserver}
config: {get_resource: testconfig}
actions: ['CREATE','UPDATE']
testserver:
type: OS::Nova::Server
properties:
image: fedora_
flavor: m1.small
key_name: heat_key
user_
outputs:
result:
value:
get_attr: [testdeploy, result]
stdout:
value:
get_attr: [testdeploy, deploy_stdout]
stderr:
value:
get_attr: [testdeploy, deploy_stderr]
status_code:
value:
get_attr: [testdeploy, deploy_status_code]
Due to the script error which I didn't noticed at first, the stack create failed. I wanted to check 'stdout' and 'stderr' defined in outputs to find out the reason. So I tried to use 'output-list' and 'output-show', but these two commands returned nothing.
I looked into the code and I found engine only shows outputs for stacks with COMPLETE status.
[1]https:/
[2]https:/
I wonder why viewing outputs of FAILED stack is forbidden. I think outputs like 'stderr' is designed for debugging FAILED stacks. It's reasonable to allow users to view these outputs when the stack is FAILED in this condition.
I changed the if clause in [1] and [2]. 'output-list' and 'output-show' works well with the template above. But what troubles me is that in some other conditions allow users to view outputs of FAILED stack is not a good idea. I use template below to create a stack:
heat_template_
resources:
testserver:
type: OS::Nova::Server
properties:
image: fedora_
flavor: m1.xxxx #this line will cause an error
outputs:
ipaddr:
value:
get_attr: [testserver, first_address]
After creation failed, I use 'output-show' to view 'ipaddr'. I noticed the engine made a query for the address. But the query is unnecessary and may cause some problem. So I wonder whether we should make changes for every resource to determine which output is allowed for users to view or change the method how they're get when the stack status is FAILED or just leave it as it was.
opinions?
Changed in heat: | |
assignee: | nobody → Victor HU (huruifeng) |
information type: | Public → Public Security |
information type: | Public Security → Public |
Changed in heat: | |
milestone: | none → juno-2 |
importance: | Undecided → Medium |
Changed in heat: | |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | juno-2 → 2014.2 |
As a matter of interest, is there a useful message in the stack event for the failed deployment resource?