Deleting instance during snapshot leaves snapshot state in saving

Bug #1143659 reported by Yang Yu
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned

Bug Description

Details:
1> Deploy an instance A.

2> To capture instance A using rest api below
Post
http://9.123.99.189:8774/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/servers/06a21e4e-61a9-4a4b-a268-4f40f817d782/action
{
"createImage" : {
"name" : "zg-image4"
}
}

3>After start capture, try to delete instance immediately.
Delete
http://9.123.99.189:8774/v2/ee5e8069ff6e41c7ad4fbb0a965885c2/servers/06a21e4e-61a9-4a4b-a268-4f40f817d782

4> Response from Poster is '204 no content'

5> List instance with 'nova list'. Instance A is deleted

6> List image with 'nova image-list', Image 'zg-image4' keep 'saving' state with no error.

Yang Yu (yuyangbj)
description: updated
Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: Instance can be deleted successfully during snapshot

Similar to:

bug 1076019 and bug 991941

summary: - Instance can be deleted successfully during capture
+ Instance can be deleted successfully during snapshot
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
milestone: none → grizzly-rc1
Revision history for this message
Feilong Wang (flwang) wrote :

Vish, after reviewed the two bugs you mentioned, I think they're different with this one. The pain point of this bug is if the instance can be deleted when it's capturing. And bug 1076019 and bug 991941 are talking about the SAVING state of the captured image.

In other words, I think we need to make sure if the instance can be deleted when there is a snapshot for this instance.

Revision history for this message
Rafi Khardalian (rkhardalian) wrote :

I'll take a shot at this. If anyone has code to submit before I get a review up, please grab the bug from me.

Changed in nova:
assignee: nobody → Rafi Khardalian (rkhardalian)
status: Triaged → In Progress
Revision history for this message
Yang Yu (yuyangbj) wrote :

Actually, we have a method to fix this bug. But we need to the point of this defect as mentioned in comment #2. Whether we permit to delete instance when it is in snapshot status or not?

Changed in nova:
assignee: Rafi Khardalian (rkhardalian) → nobody
status: In Progress → Confirmed
Revision history for this message
Vish Ishaya (vishvananda) wrote :

deleting in snapshot should be allowed so the actual bug is that the image isn't deleted / marked error.

Changed in nova:
status: Confirmed → Triaged
summary: - Instance can be deleted successfully during snapshot
+ Deleting instance during snapshot leaves snapshot state in saving
Changed in nova:
milestone: grizzly-rc1 → none
tags: added: grizzly-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Hans Lindgren (hanlind)
status: Triaged → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

This is very close to bug 991941 and bug 1064386... could you make sure your fix addresses those cases as well ? Also check proposed fix at https://review.openstack.org/25236 is compatible with yours...

Revision history for this message
Hans Lindgren (hanlind) wrote :

Hi Therry,

From looking at the description of those two bugs, bug 991941 and this one have very similar fixes where exceptions thrown during the snapshot process should be caught and handled immediately. I would say that this bug is a special case of the other where instead of setting the snapshot to some error state, it is deleted together with the deleted instance.

The separately proposed fixes for the two are basically the same and this one could easily be re-based on top of https://review.openstack.org/25236 to handle this special case.

For bug 1064386, I think it must be handled as a cleanup during service init, and as such has a completely different fix.

Revision history for this message
Hans Lindgren (hanlind) wrote :

Oops, I got the bugs in the comment above mixed up. It is bug 1064386 that is similar to this one and bug 991941 that I think should be fixed in the service init code.

Thierry Carrez (ttx)
tags: added: grizzly-backport-potential
removed: grizzly-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in nova:
assignee: Hans Lindgren (hanlind) → Yang Yu (yuyangbj)
Changed in nova:
assignee: Yang Yu (yuyangbj) → nobody
status: In Progress → Confirmed
Simon Chang (changsimon)
Changed in nova:
assignee: nobody → Simon Chang (changsimon)
Revision history for this message
Simon Chang (changsimon) wrote :

Confirmed with Yang Yu that this problem has already been fixed in Havana and Icehouse.

Changed in nova:
assignee: Simon Chang (changsimon) → nobody
status: Confirmed → Fix Released
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
Prateek Arora (parora)
Changed in nova:
assignee: nobody → Prateek Arora (parora)
Prateek Arora (parora)
Changed in nova:
assignee: Prateek Arora (parora) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.