stack-create fails for validating a resource with missing attributes:
# heat stack-create -f caller.yaml -e envi.yaml
ERROR: Failed to validate: At least one of the following properties must be specified: subnet, subnet_id
This template creates network resources in a nested template and load balancer resources in a different nested template.
The 'network; template returnes an attribute called private_subnet_id that is later being used (or should be used) by Neutron::Pool in the 'load balancer' template'.
However on validation, validating Neutron::Pool fails validation because the subnet_id parameter is empty (hasn't been created yet).
----------------------------------------------------------------------------------------------------
templates:
----------------------------------------------------------------------------------------------------
# cat caller.yaml
heat_template_version: 2013-05-23
resources:
network:
type: Test::Network
lb:
type: Test::LoadBalancer
properties:
private_subnet_id: {get_attr: [ network, private_subnet_id ]}
depends_on: network
----------------------------------------------------------------------------------------------------
# cat net.yaml
heat_template_version: 2013-05-23
description: >
Network provider template
resources:
private_network:
type: OS::Neutron::Net
properties:
name: private_net_heat
shared: false
private_subnet:
type: OS::Neutron::Subnet
properties:
name: private_subnet_heat
network: {get_resource: private_network}
ip_version: 4
cidr: 10.1.10.1/24
gateway_ip: 10.1.10.1
allocation_pools: [{"start": 10.1.10.10, "end":10.1.10.200}]
outputs:
private_network_id:
description: Private network ID
value: {get_resource: private_network}
private_subnet_id:
description: Private subnet ID
value: {get_resource: private_subnet}
----------------------------------------------------------------------------------------------------
# cat lb.yaml
heat_template_version: 2013-05-23
description: >
Load Balancing provider template
parameters:
private_subnet_id:
type: string
resources:
monitor:
type: OS::Neutron::HealthMonitor
properties:
type: TCP
delay: 5
max_retries: 5
timeout: 5
pool:
type: OS::Neutron::Pool
properties:
protocol: HTTP
monitors: [{get_resource: monitor}]
subnet_id: {get_param: private_subnet_id}
lb_method: ROUND_ROBIN
vip:
protocol_port: 80
lb:
type: OS::Neutron::LoadBalancer
properties:
protocol_port: 80
pool_id: {get_resource: pool}
----------------------------------------------------------------------------------------------------
Log: (TL;DR - )'Type': u'OS::Neutron::Pool', 'Properties': {u'subnet_id': <heat.engine.hot.functions.GetParam {get_param: u'private_subnet_id'} -> ''>
----------------------------------------------------------------------------------------------------
2015-01-04 10:46:51.635 3678 INFO heat.engine.service [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Creating stack test-test
2015-01-04 10:46:51.765 3678 INFO heat.engine.environment [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Registering Test::LoadBalancer -> file:///home/augol/FIX/lb.yaml
2015-01-04 10:46:51.765 3678 INFO heat.engine.environment [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Registering Test::Network -> file:///home/augol/FIX/net.yaml
2015-01-04 10:46:51.768 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.template.HOTemplate20130523 object at 0x4d3bc90> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:31
2015-01-04 10:46:51.768 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.parameters.HOTParameters object at 0x4dfc450> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:32
2015-01-04 10:46:51.768 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Parameter Groups. validate /opt/stack/heat/heat/engine/parameter_groups.py:43
2015-01-04 10:46:51.768 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] ['OS::project_id', 'OS::stack_id'] validate /opt/stack/heat/heat/engine/parameter_groups.py:44
2015-01-04 10:46:51.771 3678 INFO heat.common.urlfetch [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Fetching data from file:///home/augol/FIX/lb.yaml
2015-01-04 10:46:51.774 3678 INFO heat.common.urlfetch [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Fetching data from file:///home/augol/FIX/net.yaml
2015-01-04 10:46:51.777 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating TemplateResource "network"
2015-01-04 10:46:51.777 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] TemplateResource "network" - ResourceDefinition {'Type': u'Test::Network'} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.780 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.template.HOTemplate20130523 object at 0x7fe3bada1a10> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:31
2015-01-04 10:46:51.780 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.parameters.HOTParameters object at 0x4dfcf10> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:32
2015-01-04 10:46:51.780 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Parameter Groups. validate /opt/stack/heat/heat/engine/parameter_groups.py:43
2015-01-04 10:46:51.780 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] ['OS::project_id', 'OS::stack_id'] validate /opt/stack/heat/heat/engine/parameter_groups.py:44
2015-01-04 10:46:51.784 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Net "private_network"
2015-01-04 10:46:51.784 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Net "private_network" - ResourceDefinition {'Type': u'OS::Neutron::Net', 'Properties': {u'shared': False, u'name': u'private_net_heat'}} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.785 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Subnet "private_subnet"
2015-01-04 10:46:51.785 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Subnet "private_subnet" - ResourceDefinition {'Type': u'OS::Neutron::Subnet', 'Properties': {u'name': u'private_subnet_heat', u'allocation_pools': [{u'start': u'10.1.10.10', u'end': u'10.1.10.200'}], u'gateway_ip': u'10.1.10.1', u'ip_version': 4, u'cidr': u'10.1.10.1/24', u'network': <heat.engine.cfn.functions.ResourceRef {get_resource: u'private_network'} -> u'None'>}} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.786 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating TemplateResource "lb"
2015-01-04 10:46:51.787 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] TemplateResource "lb" - ResourceDefinition {'Type': u'Test::LoadBalancer', 'Properties': {u'private_subnet_id': <heat.engine.hot.functions.GetAttThenSelect {get_attr: [u'network', u'private_subnet_id']} -> None>}, 'DependsOn': u'network'} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.789 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.template.HOTemplate20130523 object at 0x4dec510> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:31
2015-01-04 10:46:51.789 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] <heat.engine.hot.parameters.HOTParameters object at 0x4e0c190> __init__ /opt/stack/heat/heat/engine/parameter_groups.py:32
2015-01-04 10:46:51.789 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Parameter Groups. validate /opt/stack/heat/heat/engine/parameter_groups.py:43
2015-01-04 10:46:51.790 3678 DEBUG heat.engine.parameter_groups [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] ['OS::project_id', u'private_subnet_id', 'OS::stack_id'] validate /opt/stack/heat/heat/engine/parameter_groups.py:44
2015-01-04 10:46:51.792 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating HealthMonitor "monitor"
2015-01-04 10:46:51.792 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] HealthMonitor "monitor" - ResourceDefinition {'Type': u'OS::Neutron::HealthMonitor', 'Properties': {u'delay': 5, u'max_retries': 5, u'type': u'TCP', u'timeout': 5}} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.792 3678 INFO heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Validating Pool "pool"
2015-01-04 10:46:51.793 3678 DEBUG heat.engine.resource [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Pool "pool" - ResourceDefinition {'Type': u'OS::Neutron::Pool', 'Properties': {u'subnet_id': <heat.engine.hot.functions.GetParam {get_param: u'private_subnet_id'} -> ''>, u'vip': {u'protocol_port': 80}, u'lb_method': u'ROUND_ROBIN', u'protocol': u'HTTP', u'monitors': [<heat.engine.cfn.functions.ResourceRef {get_resource: u'monitor'} -> u'None'>]}} validate /opt/stack/heat/heat/engine/resource.py:840
2015-01-04 10:46:51.795 3678 INFO heat.engine.stack [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] At least one of the following properties must be specified: subnet, subnet_id
2015-01-04 10:46:51.795 3678 INFO heat.engine.stack [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 None] Failed to validate: At least one of the following properties must be specified: subnet, subnet_id
2015-01-04 10:46:51.796 3678 INFO oslo.messaging._drivers.impl_rabbit [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 ] Connecting to AMQP server on 10.35.160.83:5672
2015-01-04 10:46:51.810 3678 INFO oslo.messaging._drivers.impl_rabbit [req-f0769e65-5736-4ddc-86cb-ee75dbf5f8d2 ] Connected to AMQP server on 10.35.160.83:5672
/usr/lib/python2.7/site-packages/amqp/channel.py:616: VDeprecationWarning: The auto_delete flag for exchanges has been deprecated and will be removed
from py-amqp v1.5.0.
warn(VDeprecationWarning(EXCHANGE_AUTODELETE_DEPRECATED))
/usr/lib/python2.7/site-packages/amqp/channel.py:616: VDeprecationWarning: The auto_delete flag for exchanges has been deprecated and will be removed
from py-amqp v1.5.0.
warn(VDeprecationWarning(EXCHANGE_AUTODELETE_DEPRECATED))
Fix proposed to branch: master /review. openstack. org/145125
Review: https:/