template with autoscaling group gets stuck and never completes

Bug #1436128 reported by Miguel Grinberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Miguel Grinberg

Bug Description

The following template creates an autoscaling group plus a separate server. It assigns the "current_size" attribute of the asg to the other server as metadata. When running the template, the autoscaling group completes, but the other server never starts. The same template without the metadata variable runs through completion just fine.

Here is the template:

  heat_template_version: 2013-05-23

  parameters:
    image:
      type: string
      label: Image name or ID
      default: cirros
    flavor:
      type: string
      label: Flavor
      default: m1.tiny
    network:
      type: string
      label: Network
      default: private

  resources:
    asg:
      type: OS::Heat::AutoScalingGroup
      properties:
        min_size: 1
        desired_capacity: 3
        max_size: 5
        resource:
          type: OS::Nova::Server
          properties:
            image: { get_param: image }
            flavor: { get_param: flavor }
            networks:
              - network: { get_param: network }

    lb:
      type: OS::Nova::Server
      properties:
        image: { get_param: image }
        flavor: { get_param: flavor }
        networks:
          - network: { get_param: network }
        metadata:
          sz: { get_attr: [asg, current_size] }

Changed in heat:
assignee: nobody → Miguel Grinberg (miguelgrinberg)
Angus Salkeld (asalkeld)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
milestone: none → next
tags: added: kilo-rc-potential
Revision history for this message
Miguel Grinberg (miguelgrinberg) wrote :

Further investigation revealed that the stack gets stuck when an exception is raised when evaluating attributes. Testing on latest Kilo release i was unable to reproduce the problem with the template shown above, but I can reproduce when I replace the last line with an invalid attribute, for example:

        sz: { get_attr: [asg, bad_attr] }

I was working with Juno last week when I found this bug. I'm thinking that maybe I mistyped "current_size" and that is why it hung for me on that property.

Changed in heat:
status: Triaged → In Progress
Angus Salkeld (asalkeld)
Changed in heat:
milestone: next → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/168203
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=29365bda1cab48aad7b98907af521130321e526a
Submitter: Jenkins
Branch: master

commit 29365bda1cab48aad7b98907af521130321e526a
Author: Angus Salkeld <email address hidden>
Date: Fri Mar 27 12:00:42 2015 +1000

    Set state to failed if we get a base exception

    The scheduler only raises ExceptionGroup if aggregate_exceptions is
    True. This change adds a catch-all exception handler that sets the stack
    to failed on any exceptions.

    Co-Authored-By: Miguel Grinberg <email address hidden>
    Change-Id: I76a6e87924416335921115ec3147a991659cfb2e
    Closes-Bug: #1436128

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-rc1 → 2015.1.0
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.