HOT constraints translation broken
Bug #1224111 reported by
Randall Burt
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Thomas Spatzier |
Bug Description
Due to the way schemata converts parameters to properties, HOT cannot be used as a provider template due to the mis-match between AWS-style parameter validation attributes and HOT-style constraints.
Changed in heat: | |
status: | New → Confirmed |
importance: | Undecided → High |
milestone: | none → havana-rc1 |
Changed in heat: | |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | havana-rc1 → 2013.2 |
To post a comment you must log in.
Confirmed, my testing indicates the same. We really need to fix this ASAP..
Here's a reproducer.
1. Create minimal provider resource template which has constraints on a parameter
# cat /tmp/hot_ minimal. yaml version: 2013-05-23
heat_template_
parameters:
description: InstanceType must be one of m1.small, m1.medium or m1.large
description: >
description: DBName must be between 1 and 64 characters Z][a-zA- Z0-9]*'
description: >
characters
InstanceType:
type: string
description: Instance type for WordPress server
default: m1.small
constraints:
- allowed_values: [m1.small, m1.medium, m1.large]
ImageId:
type: string
description: ID of the image to use for the WordPress server
default: F18-x86_64-cfntools
constraints:
- allowed_values: [ F18-i386-cfntools, F18-x86_64-cfntools ]
Image ID bust be either F18-i386-cfntools or F18-x86_64-cfntools
DBName:
type: string
description: WordPress database name
default: wordpress
constraints:
- length: { min: 1, max: 64 }
- allowed_pattern: '[a-zA-
DBName must begin with a letter and contain only alphanumeric
resources: instance:
wordpress_
type: OS::Nova::Server
properties:
image: { get_param: ImageId }
flavor: { get_param: InstanceType }
2. Create an environment file pointing to the template above
# cat env_minimal.yaml :Custom: :Server" : file:// /tmp/hot_ minimal. yaml
resource_registry:
# Define a custom resource type based on a template
"My:
3 . Create a template which uses the provder resource
# cat minimal_test.yaml version: 2013-05-23
heat_template_
resources: instance:
wordpress_
type: My::Custom::Server
4. Launch the template
heat --debug create test_stack --template- file=./ minimal_ test.yaml --environment- file=./ env_minimal. yaml
We get this in the engine log:
2013-09-18 14:51:01.628 7560 INFO heat.engine. environment [-] Registering My::Custom::Server -> file:// /tmp/hot_ minimal. yaml common. rpc.amqp [-] Exception during message handling common. rpc.amqp Traceback (most recent call last): common. rpc.amqp File "/usr/lib/ python2. 7/site- packages/ heat/openstack/ common/ rpc/amqp. py", line 461, in _process_data common. rpc.amqp **args) common. rpc.amqp File "/usr/lib/ python2. 7/site- packages/ heat/openstack/ common/ rpc/dispatcher. py", line 172, in dispatch common. rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs) common. rpc.amqp File "/usr/lib/ python2. 7/site- packages/ heat/engine/ service. py", line 56, in wrapped common. rpc.amqp return func(self, ctx, *args, **kwargs) common. r...
SHDEBUG getting num val for MinLength from [(1, u'DBName must be between 1 and 64 characters')]
2013-09-18 14:51:01.630 7560 ERROR heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.
2013-09-18 14:51:01.630 7560 TRACE heat.openstack.