I wouldn't say that we leak images here, we still have references to the snapshot in Glance and can remove these later once the instance disk is flattened. We also end up in this situation when initially booting an instance from a rbd image, thus my reluctance to call this a genuine bug :
$ nova boot --image cirros-raw --flavor 1 test
[..]
$ sudo rbd -p vms ls -l
NAME SIZE PARENT FMT PROT LOCK
1987d04b-10ce-4724-80bc-3ba699a45ded_disk 1024M images/a906bdce-47e2-4eb1-abeb-5f390fc8493d@snap 2
$ glance image-delete a906bdce-47e2-4eb1-abeb-5f390fc8493d
Unable to delete image 'a906bdce-47e2-4eb1-abeb-5f390fc8493d' because it is in use.
I wouldn't say that we leak images here, we still have references to the snapshot in Glance and can remove these later once the instance disk is flattened. We also end up in this situation when initially booting an instance from a rbd image, thus my reluctance to call this a genuine bug :
$ nova boot --image cirros-raw --flavor 1 test 10ce-4724- 80bc-3ba699a45d ed_disk 1024M images/ a906bdce- 47e2-4eb1- abeb-5f390fc849 3d@snap 2 47e2-4eb1- abeb-5f390fc849 3d 47e2-4eb1- abeb-5f390fc849 3d' because it is in use.
[..]
$ sudo rbd -p vms ls -l
NAME SIZE PARENT FMT PROT LOCK
1987d04b-
$ glance image-delete a906bdce-
Unable to delete image 'a906bdce-