OS::Cinder::Volume failed when using imageRef property

Bug #1222676 reported by Mitsuru Kanabuchi
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Liang Chen

Bug Description

When using "OS::Cinder::Volume" with "imageRef" property, create volume is never succeed.

The volume status (from cinder list) is "downloading" or "available" when create volume resource from image via heat.
But the stack status was changed to "CREATE_FAILED" before the volume status to be available.

The following error occurs in heat-engine:
======================================================================
2013-09-09 15:23:05.026 6035 ERROR heat.engine.resource [-] CREATE : CinderVolume "volume"
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource Traceback (most recent call last):
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 360, in _do_action
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource while not check(handle_data):
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/volume.py", line 85, in check_create_complete
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource raise exception.Error(vol.status)
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource Error: downloading
2013-09-09 15:23:05.026 6035 TRACE heat.engine.resource
2013-09-09 15:23:05.064 6035 DEBUG heat.engine.scheduler [-] Task resource_action cancelled cancel /opt/stack/heat/heat/engine/scheduler.py:187
2013-09-09 15:23:05.078 6035 DEBUG heat.engine.scheduler [-] Task stack_task from Stack "image-2-volume" complete step /opt/stack/heat/heat/engine/scheduler.py:170
2013-09-09 15:23:05.079 6035 WARNING heat.engine.service [-] Stack create failed, status FAILED
======================================================================

The template file is:
======================================================================
{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Parameters" : {
    "ImageID" : {
      "Type" : "String"
    }
  },
  "Resources" : {
    "volume": {
      "Type": "OS::Cinder::Volume",
      "Properties": {
        "availability_zone": "nova",
        "size": 1,
        "imageRef": { "Ref": "ImageID" }
      }
    }
  }
}
======================================================================

The command Line is:
======================================================================
$ heat stack-create -f image-2-volume.template -P "ImageID=e3f13c23-d06d-4e42-915c-64c89b49bcae" image-2-volume
======================================================================

I think heat-engine have to allow "downloading" status.
The draft to modify heat/engine/resources/volume.py is:
======================================================================
    def check_create_complete(self, vol):
        vol.get()

        if vol.status == 'available':
            return True
        elif vol.status == 'creating':
            return False
        elif vol.status == 'restoring-backup':
            return False
+ elif vol.status == 'downloading':
+ return False
        else:
            raise exception.Error(vol.status)
======================================================================

Changed in heat:
milestone: none → havana-rc1
importance: Undecided → High
status: New → Confirmed
Liang Chen (cbjchen)
Changed in heat:
assignee: nobody → Liang Chen (cbjchen)
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/46455

Changed in heat:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/46455
Committed: http://github.com/openstack/heat/commit/326788bbd2a3fac1fd10e9e81de25e20ac3bb1c1
Submitter: Jenkins
Branch: master

commit 326788bbd2a3fac1fd10e9e81de25e20ac3bb1c1
Author: Liang Chen <email address hidden>
Date: Fri Sep 13 12:55:13 2013 +0800

    Consider downloading a valid status for CinderVolume

    "downloading" should be considered a in-progress state while creating a volume
    from an image. Because Cinder will first create a volume with specified size
    and set its status to downloading, then start fetching the image from glance
    and copying it to the volume.

    Fixes bug #1222676

    Change-Id: I573440f3184c3d47df0d7e78146b0ed030606d86

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.