Nested stacks not validated until creation

Bug #1388140 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
huangtianhua

Bug Description

When creating nested stacks, it should be possible to recurse and do at least static template validation when we validate the parent stack. Currently we don't fail fast, so the stack create fails, even if there's an error in the nested template which should fail validation:

-bash-4.2$ cat parent.yaml
heat_template_version: 2013-05-23
resources:
  volume_server:
    type: nested.yaml

-bash-4.2$ cat nested.yaml
heat_template_version: 2013-05-23
resources:
  server:
    type: OS::Nova::Server
    properties:
      image: fedora-software-config2
      flavor: m1.small
  volume:
    type: OS::Cinder::Volume
    properties:
      size: { get_param: volume_size }
      description: Volume for stack
  volume_attachment:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: { get_resource: volume }
      instance_uuid: { get_resource: instance }

Here, the { get_resource: instance } is wrong (instance should be server), and the stack create fails like this:

$ heat stack-list
+--------------------------------------+------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+----------------------+
| 8a2f9569-70b6-4384-9175-9065ee3df1bd | p1 | CREATE_FAILED | 2014-10-31T15:24:26Z |
+--------------------------------------+------------+-----------------+----------------------+

It should be possible to return a validation failure before we create anything in this case.

Steven Hardy (shardy)
summary: - Nested stacks not valididated until creation
+ Nested stacks not validated until creation
Revision history for this message
Steven Hardy (shardy) wrote :

Relatedly, AutoScalingGroup doesn't validate before creation:

heat_template_version: 2013-05-23

resources:
  config:
    type: OS::Heat::AutoScalingGroup
    properties:
      resource:
        type: My::ConfiguredServer
      desired_capacity: 2
      max_size: 4
      min_size: 1

This ends up CREATE_FAILED if you forget to pass the environment mapping the My::ConfiguredServer type.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
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/132625

Changed in heat:
status: New → In Progress
Revision history for this message
huangtianhua (huangtianhua) wrote :

The patch https://review.openstack.org/132625 for static validation for nested template, and I will report another bug for validation the resource type for OS::Heat::AutoScalingGroup.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit c31c34f8dfd0919bf46a975701c139073115debc
Author: huangtianhua <email address hidden>
Date: Tue Nov 4 14:46:39 2014 +0800

    Do static template validation for nested stacks

    Currently we don't fail fast, even if there is an error
    in the nested template which should fail validation.
    This change to recurse and do static template validation
    for nested stack resources.

    Change-Id: I572ded640582419e0888e4b9f8eed3a3432d6121
    Closes-Bug: #1388140
    Closes-Bug: #1389104

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