Bug 1292152

Summary: Heat template fails in validation started with OSP7
Product: Red Hat OpenStack Reporter: Martin Schuppert <mschuppe>
Component: openstack-heatAssignee: Thomas Hervé <therve>
Status: CLOSED ERRATA QA Contact: Amit Ugol <augol>
Severity: high Docs Contact:
Priority: high    
Version: 7.0 (Kilo)CC: adahms, dmaley, jcoufal, mburns, rhel-osp-director-maint, sbaker, shardy, therve, yeylon, zbitter
Target Milestone: z4Keywords: GSSTriaged, ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-heat-2015.1.2-6.el7ost Doc Type: Bug Fix
Doc Text:
This update resolves an issue that would cause deployment of Heat templates to fail during resource validation due to being unable to correctly identify network IDs.
Story Points: ---
Clone Of:
: 1330384 (view as bug list) Environment:
Last Closed: 2016-02-18 16:42:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1330384    
Attachments:
Description Flags
heat template to reproduce none

Description Martin Schuppert 2015-12-16 15:18:38 UTC
Created attachment 1106477 [details]
heat template to reproduce

Description of problem:
Checked the heat.engine log, during the resource validation, heat complained network or network_id shall be included in properties. 
However, the same script and template has worked fine in JUNO.

The error appears is the following:
ERROR: Failed to validate: Failed to validate: Failed to validate: At least one of the following properties must be specified: network, network_id

Version-Release number of selected component (if applicable):
openstack-heat-common-2015.1.0-4.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
With attached template
1. heat stack-create -f ./main.hot.yaml  test

Actual results:

Validation fails with "Failed to validate: At least one of the following properties must be specified: network, network_id" which was working in OSP6 :

2015-12-16 09:21:31.491 6979 INFO heat.engine.service [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Creating stack test
2015-12-16 09:21:31.633 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.template.HOTemplate20130523 object at 0x5013c50> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:32
2015-12-16 09:21:31.633 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.parameters.HOTParameters object at 0x526da50> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:33
2015-12-16 09:21:31.633 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Parameter Groups. validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:44
2015-12-16 09:21:31.634 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] ['OS::project_id', 'OS::stack_id'] validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:45
2015-12-16 09:21:31.635 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/my_net.hot.yaml -> file:///root/test/my_net.hot.yaml
2015-12-16 09:21:31.635 6979 INFO heat.common.urlfetch [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Fetching data from file:///root/test/my_net.hot.yaml
2015-12-16 09:21:31.637 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/custom_resource.hot.yaml -> file:///root/test/custom_resource.hot.yaml
2015-12-16 09:21:31.638 6979 INFO heat.common.urlfetch [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Fetching data from file:///root/test/custom_resource.hot.yaml
2015-12-16 09:21:31.640 6979 INFO heat.engine.resource [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating TemplateResource "my_net"
2015-12-16 09:21:31.640 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/custom_resource.hot.yaml -> file:///root/test/custom_resource.hot.yaml
2015-12-16 09:21:31.642 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/my_net.hot.yaml -> file:///root/test/my_net.hot.yaml
2015-12-16 09:21:31.644 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.template.HOTemplate20130523 object at 0x4a92150> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:32
2015-12-16 09:21:31.644 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.parameters.HOTParameters object at 0x526de10> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:33
2015-12-16 09:21:31.644 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Parameter Groups. validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:44
2015-12-16 09:21:31.644 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] ['OS::project_id', 'OS::stack_id'] validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:45
2015-12-16 09:21:31.646 6979 INFO heat.engine.resource [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Net "neutron_net"
2015-12-16 09:21:31.647 6979 INFO heat.engine.resource [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating TemplateResource "my_resource"
2015-12-16 09:21:31.647 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/custom_resource.hot.yaml -> file:///root/test/custom_resource.hot.yaml
2015-12-16 09:21:31.648 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/my_net.hot.yaml -> file:///root/test/my_net.hot.yaml
2015-12-16 09:21:31.650 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.template.HOTemplate20130523 object at 0x4a92250> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:32
2015-12-16 09:21:31.650 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.parameters.HOTParameters object at 0x526d790> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:33
2015-12-16 09:21:31.650 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Parameter Groups. validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:44
2015-12-16 09:21:31.651 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] [u'my_net_param', 'OS::project_id', 'OS::stack_id'] validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:45
2015-12-16 09:21:31.652 6979 INFO heat.engine.resource [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating ResourceGroup "rg"
2015-12-16 09:21:31.654 6979 INFO heat.engine.environment [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Registering file:///root/test/my_net.hot.yaml -> file:///root/test/my_net.hot.yaml
2015-12-16 09:21:31.656 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.template.HOTemplate20130523 object at 0x531eb50> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:32
2015-12-16 09:21:31.656 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] <heat.engine.hot.parameters.HOTParameters object at 0x5156750> __init__ /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:33
2015-12-16 09:21:31.656 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Parameter Groups. validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:44
2015-12-16 09:21:31.656 6979 DEBUG heat.engine.parameter_groups [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] ['OS::project_id', 'OS::stack_id'] validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:45
2015-12-16 09:21:31.658 6979 INFO heat.engine.resource [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Validating Port "0"
2015-12-16 09:21:31.658 6979 INFO heat.engine.stack [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] At least one of the following properties must be specified: network, network_id
2015-12-16 09:21:31.659 6979 INFO heat.engine.stack [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Failed to validate: At least one of the following properties must be specified: network, network_id
2015-12-16 09:21:31.659 6979 INFO heat.engine.stack [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Failed to validate: Failed to validate: At least one of the following properties must be specified: network, network_id
2015-12-16 09:21:31.660 6979 DEBUG oslo_messaging.rpc.dispatcher [req-94fc849d-2d6f-4350-a3b5-4561e4bf3ea5 admin admin] Expected exception during message handling (Failed to validate: Failed to validate: At least one of the following properties must be specified: network, network_id) _dispatch_and_reply /usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py:145
...

Expected results:

Validation works as before.

Additional info:

Issue has been reported upstream at [1] , which is a duplicate of [2]. Verified that validation of attached heat template work with a backport of upstream commit at [3] 

[1] https://bugs.launchpad.net/heat/+bug/1522269
[2] https://bugs.launchpad.net/heat/+bug/1518676
[3] https://review.openstack.org/#/c/248719/

Comment 3 Steven Hardy 2015-12-17 13:30:00 UTC
Assigning to therve as he's the author of https://review.openstack.org/#/c/248719/ and has kindly offered to look into a suitable backport for OSP7/kilo.

https://review.openstack.org/#/c/258307/ is the backport of that fix to liberty, but it looks like that is not cleanly backportable to OSP7/kilo so we may need a different fix and/or additional backports.

Comment 4 Thomas Hervé 2015-12-17 14:01:24 UTC
Reproduced on a kilo environment. We can't backport the original fix as it relies on other features, but I made a new patch which ought to fix the issue: https://review.openstack.org/#/c/259023/

Comment 13 errata-xmlrpc 2016-02-18 16:42:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-0266.html