Cannot use default AZ with volume

Bug #1207416 reported by Zane Bitter
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Zane Bitter

Bug Description

The AvailabilityZone property of as AWS::EBS::Volume resource is required. The correct way to supply it is almost invariably by doing:

  {"Fn::GetAtt": ["MyInstance", "AvailabilityZone"]}

for the AWS::EC2::Instance it needs to be attached to. The AvailabilityZone attribute of the instance is obtained from the AvailabilityZone property, which is *optional*.

In the case where the AvailabilityZone of the Instance is not specified, we should pass None as the availability_zone value to Cinder to force it to use the default. Instead we are passing an empty string ('').

Revision history for this message
Zane Bitter (zaneb) wrote :
Revision history for this message
Zane Bitter (zaneb) wrote :

The ideal fix here would be to actually return the name of the default AZ from Instance.FnGetAtt('AvailabilityZone') even when it is not explicitly supplied as a property.

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/39753

Changed in heat:
assignee: nobody → Zane Bitter (zaneb)
status: New → In Progress
Revision history for this message
Zane Bitter (zaneb) wrote :

Steve B: is this ^ the right fix, or do we need to reconsider how we treat None when resolving references? I'm wondering how many similar cases might be lurking :/

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

see comment in review

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

Reviewed: https://review.openstack.org/39753
Committed: http://github.com/openstack/heat/commit/8ede7612a0fcf56fbce2ac392812de51f2ccb878
Submitter: Jenkins
Branch: master

commit 8ede7612a0fcf56fbce2ac392812de51f2ccb878
Author: Zane Bitter <email address hidden>
Date: Thu Aug 1 17:22:18 2013 +0200

    Make Volumes work with the default AvailabilityZone

    The most common way to specify an AvailabiltyZone for a volume is to grab
    it from the Instance it is going to be attached to:

        "AvailabilityZone" : {"Fn::GetAtt": ["WikiDatabase",
                                             "AvailabilityZone"]},

    But the first unit tests to check the value passed to Cinder for the AZ,
    introduced in 134b11ccd145f982b7173bc9a5d0f1bc3e8eef8c, just forced the
    value instead of obtaining it from the Instance.

    Add a unit test to check the common case, and fix the resulting error (an
    empty string is returned instead of None).

    Fixes bug #1207416

    Change-Id: I83ea2f3f0c417eb9e97abdf27a9eaffd441cb070

Changed in heat:
status: In Progress → Fix Committed
Steven Hardy (shardy)
tags: added: grizzly-backport-potential
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-3 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
no longer affects: heat/grizzly
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.