Image block device mappings for snapshots of instances specify delete_on_termination=null

Bug #1384386 reported by Samuel Matzek
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned

Bug Description

Nova Juno

Scenario:
1. Boot an instance from a volume.
2. Nova snapshot the instance. This produces a Glance image with a block device mapping property like this:
[{"guest_format": null, "boot_index": 0, "no_device": null, "snapshot_id": "1a642ca8-210f-4790-ab93-00b6a4b86a14", "delete_on_termination": null, "disk_bus": null, "image_id": null, "source_type": "snapshot", "device_type": "disk", "volume_id": null, "destination_type": "volume", "volume_size": null}]

3. Create an instance from the Glance image. Nova creates a new Cinder volume from the image's Cinder snapshot and attaches it to the instance.
4. Delete the instance.

Problem: The Cinder volume created at step 3 remains.

The block device mappings for Cinder snapshots created during VM snapshot and placed into the Glance image should specify "delete_on_termination": True so that the Cinder volumes created for VMs booted from the image will be cleaned up on VM deletion.

Tags: volumes
Joe Gordon (jogo)
tags: added: volumes
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
ugvddm (271025598-9)
Changed in nova:
assignee: nobody → ugvddm (271025598-9)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Sean Dague (<email address hidden>) on branch: master
Review: https://review.openstack.org/132299
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Removing "In Progress" status and assignee as change is abandoned.

Changed in nova:
status: In Progress → Confirmed
assignee: ugvddm (271025598-9) → nobody
Revision history for this message
Feodor Tersin (ftersin) wrote :

https://bugs.launchpad.net/nova/+bug/1370177 has the same reasons, but complains of more image attributes.

Revision history for this message
Charlotte Han (hanrong) wrote :

This committed patch set had resolved this bug:

https://review.openstack.org/#/c/186910/

Changed in nova:
status: Confirmed → Fix Committed
Revision history for this message
Charlotte Han (hanrong) wrote :

1. I had not reproduced this bug in stable/mitaka.

2. version
[root@SBCJSlot5Rack2Centos7 nova]# git log -1
commit eab2d5f54ab8ab92c2151b7c1dc3a79cedefd4bc
Merge: 9eed73f aefc177
Author: Jenkins <email address hidden>
Date: Thu Apr 21 01:51:46 2016 +0000

    Merge "Fixes unexpectedly passing functional test." into stable/mitaka

3. block device mapping is
[{"guest_format": null, "boot_index": 0, "delete_on_termination": true, "no_device": null, "snapshot_id": "ce7f5a2d-3c19-4a5c-887a-07a13bf6d50f", "device_name": "/dev/vda", "disk_bus": "virtio", "image_id": null, "source_type": "snapshot", "device_type": "disk", "volume_id": null, "destination_type": "volume", "volume_size": 1}]
or
[{"guest_format": null, "boot_index": 0, "delete_on_termination": false, "no_device": null, "snapshot_id": "aa29c94d-e5a5-479d-8371-e155d2f934a1", "device_name": "/dev/vda", "disk_bus": "virtio", "image_id": null, "source_type": "snapshot", "device_type": "disk", "volume_id": null, "destination_type": "volume", "volume_size": 1}]

The value of "delete_on_termination" is determined by the block device mapping of instance's booted volume.

Changed in nova:
status: Fix Committed → Fix Released
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.