Autoscaling resource fails during preview because has not Size property

Bug #1322583 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Sergey Kraynev

Bug Description

When you try to preview stack with follow command:

skr@ubuntu:~$ heat stack-preview demos -f heat-templates/cfn/F17/AutoScalingCeilometer.yaml -P="KeyName=heat_key"

you will get error:

ERROR: u'u\'WebServerGroup: Invalid Property Size\'\nTraceback (most recent call last):\n\n File "/opt/stack/heat/heat/openstack/common/rpc/amqp.py", line 462, in _process_data\n **args)\n\n File "/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n\n File "/opt/stack/heat/heat/engine/service.py", line 62, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File "/opt/stack/heat/heat/engine/service.py", line 505, in preview_stack\n return api.format_stack_preview(stack)\n\n File "/opt/stack/heat/heat/engine/api.py", line 147, in format_stack_preview\n fmt_resources = map(format_resource, stack.preview_resources())\n\n File "/opt/stack/heat/heat/engine/parser.py", line 443, in preview_resources\n for resource in self.resources.itervalues()]\n\n File "/opt/stack/heat/heat/engine/stack_resource.py", line 102, in preview\n template = parser.Template(self.child_template())\n\n File "/opt/stack/heat/heat/engine/resources/autoscaling.py", line 436, in child_template\n num_instances = int(self.properties[self.SIZE])\n\n File "/opt/stack/heat/heat/engine/properties.py", line 331, in __getitem__\n {\'prefix\': self.error_prefix, \'key\': key})\n\nKeyError: u\'WebServerGroup: Invalid Property Size\'\n'

There is such traceback in heat-engine log:

2014-05-23 07:15:40.565 ERROR heat.openstack.common.rpc.amqp [req-013ab763-bdf1-4606-b658-aef64d00c9cd demo demo] Exception during message handling
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp Traceback (most recent call last):
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/openstack/common/rpc/amqp.py", line 462, in _process_data
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp **args)
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/service.py", line 62, in wrapped
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp return func(self, ctx, *args, **kwargs)
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/service.py", line 505, in preview_stack
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp return api.format_stack_preview(stack)
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/api.py", line 147, in format_stack_preview
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp fmt_resources = map(format_resource, stack.preview_resources())
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/parser.py", line 443, in preview_resources
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp for resource in self.resources.itervalues()]
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/stack_resource.py", line 102, in preview
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp template = parser.Template(self.child_template())
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/resources/autoscaling.py", line 436, in child_template
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp num_instances = int(self.properties[self.SIZE])
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/properties.py", line 331, in __getitem__
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp {'prefix': self.error_prefix, 'key': key})
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp KeyError: u'WebServerGroup: Invalid Property Size'
2014-05-23 07:15:40.565 TRACE heat.openstack.common.rpc.amqp

It happens because of AutoScalingGroup use parent child_template function with unknown property name Size.
So it should have own (correct) child_template function with properties used during creation.

Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/95142

Changed in heat:
status: New → In Progress
summary: - Autoscaling resource fails during preview
+ Autoscaling resource fails during preview because have not Size property
summary: - Autoscaling resource fails during preview because have not Size property
+ Autoscaling resource fails during preview because has not Size property
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/95142
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=042eb7472cf1842bfc56cdc60b45b60a23285b95
Submitter: Jenkins
Branch: master

commit 042eb7472cf1842bfc56cdc60b45b60a23285b95
Author: Sergey Kraynev <email address hidden>
Date: Fri May 23 07:01:42 2014 -0400

    Adding own child_template for AutoScalingGroup

    Resource AutoScalingGroup fails during preview, because it uses the
    parent child_template function with an invalid property Size. So
    AutoScalingGroup should have its own child_template with correct
    properties. Also new method child_template is used during handle_create.

    Change-Id: I0068c1eaf19464c39348823160b665f538fec583
    Closes-Bug: #1322583

Changed in heat:
status: In Progress → Fix Committed
Changed in heat:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-2 → 2014.2
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.