KeyError raised when deleting stack

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

Bug Description

1. create a stack with a nova server
2. snapshot the stack
3. there is something wrong happened while snapshot complete checking
4. the stack went to SNAPSHOT_FAILED status
5. delete the stack, then a KeyError exception raised:
......
  File "/opt/stack/heat/heat/engine/resource.py", line 832, in delete_snapshot
    yield self.action_handler_task('delete_snapshot', args=[data])
  File "/opt/stack/heat/heat/engine/scheduler.py", line 315, in wrapper
    step = next(subtask)
  File "/opt/stack/heat/heat/engine/resource.py", line 530, in action_handler_task
    handler_data = handler(*args)
  File "/opt/stack/heat/heat/engine/resources/openstack/nova/server.py", line 1428, in handle_delete_snapshot
    image_id = snapshot['resource_data']['snapshot_image_id']
KeyError: 'snapshot_image_id'
......

I believe we should set the data 'snapshot_image_id' immediately after creating the snapshot image, otherwise the image will residue in some cases.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Qiming Teng (tengqim)
Changed in heat:
importance: Undecided → Medium
status: New → Confirmed
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/177666

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/177666
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=ebe741f6f135d26878e81d04f74e746882037b14
Submitter: Jenkins
Branch: master

commit ebe741f6f135d26878e81d04f74e746882037b14
Author: huangtianhua <email address hidden>
Date: Mon Apr 27 15:04:21 2015 +0800

    Fix snapshot image/backup residue in backend

    Set resource data 'snapshot_image_id' of server and
    'backup_id' of volume immediately after creating the
    image and backup while snapshoting. Otherwise there
    will image/backup residue in backend.

    Change-Id: Id7441f0c9d537b417488c2857019802872239b2e
    Closes-Bug: #1448842

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