Fn::GetAtt works incorrect when validating block_device_mapping

Bug #1230140 reported by JunJie Nan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Thomas Herve

Bug Description

Step to reproduce the problem:
1. template as below:
heat_template_version: 2013-05-23
parameters:
  key_name: {type: string, default: heat_key}
  flavor: {type: string, default: m1.small}
  image_id: {type: string, default: c687fd63-97c5-40e6-86a4-cd2e81672f17}
  availability_zone: {type: string, default: nova}
resources:
  a:
    type: OS::Nova::Server
    properties:
      flavor: {Ref: flavor}
      key_name: {Ref: key_name}
      block_device_mapping:
        - device_name: vda
          volume_id: {'Fn::GetAtt': [disk, id]}
          delete_on_termination: false
      user_data:
        Fn::Base64: '80'
  disk:
    type: OS::Cinder::Volume
    properties:
      size: 2
      imageRef: {Ref: image_id}
      availability_zone: {Ref: availability_zone}
2. heat stack-create -f ....

Error found: Either volume_id or snapshot_id must be specified for device mapping vda

If we change:
          volume_id: {'Fn::GetAtt': [disk, id]}
to
          volume_id: {Ref: disk}
the error will disappear.

Final solution:

Disable volume_id: {'Fn::GetAtt': [disk, id]} in code and use volume_id: {Ref: disk} instead.

JunJie Nan (nanjj)
Changed in heat:
assignee: nobody → Jun Jie Nan (nanjj)
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/48216

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

Let's remove the id attribute instead.

Changed in heat:
assignee: Jun Jie Nan (nanjj) → Thomas Herve (therve)
milestone: none → havana-rc1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

JunJie Nan (nanjj)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/48225
Committed: http://github.com/openstack/heat/commit/1bf3dd39f36d6ac4bd491dcb848018ec9eff24cb
Submitter: Jenkins
Branch: master

commit 1bf3dd39f36d6ac4bd491dcb848018ec9eff24cb
Author: Thomas Herve <email address hidden>
Date: Wed Sep 25 14:01:49 2013 +0200

    Remove CinderVolume id attribute

    Using the id attribute can result in problems when validating a
    template, as the resource_id is empty at that point, so we remove it to
    prevent issues, as people ought to use Ref anyway.

    Closes-Bug: #1230140
    Change-Id: I16778d8036e7e2ccacf93caa4581ae0b0368b7c2

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: havana-rc1 → 2013.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.