deletion of 0-sized active image

Asked by Andrey Nikolaev on 2016-02-12

Hello. I'm usin OpenStack kilo. I've created 0-sized image by accident due to my error. I've missed that file I used for image creation was 0-sized. Image is in active state, so I can't use glance image-upload due to:

409 Conflict: Image status transition from active to saving is not allowed (HTTP 409)

Neither I can delete this image due to:

 HTTPInternalServerError (HTTP 500)

In my case glance uses radosgw as a backed, but I guess it is hardly relevant which backend is operated.
Image is just showing up in
glance image-show
# glance image-show a4c54116-caa2-4113-ada2-fea2127f8b4d
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| container_format | bare |
| created_at | 2016-02-12T12:05:46Z |
| disk_format | raw |
| id | a4c54116-caa2-4113-ada2-fea2127f8b4d |
| min_disk | 0 |
| min_ram | 0 |
| name | wst |
| owner | 01e76893be8b41e4a42768ff5c5b24fc |
| protected | False |
| size | 0 |
| status | active |
| tags | [] |
| updated_at | 2016-02-12T17:14:20Z |
| virtual_size | None |
| visibility | public |
+------------------+--------------------------------------+

So, the primary question:
How can I delete it?
Secondary question -- could it be considered a bug, when system creates image it can't operate further?
May that be advisable to create special commands in glanceclient which either can change state of image or can safely delete image entry in database as a whole?
thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
2016-02-12
Last reply:
2016-05-10
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

> How can I delete it?

Kilo may not be supported anymore. There seems to be a bug here as you should be able to delete the image, 500 is merely because of that corner case with size 0 images.

> Secondary question -- could it be considered a bug, when system creates image it can't operate further?

This cannot be Glance's responsibility as what you can boot from is vendor and operator specific things. There is a effort in Glance to add scripts that will enable operators add information on the image to make it boot-able in that deployment. But there cannot be any guarantee on that, also the boot-ablity testing is a NP complete problem to address in any particular one service. The deal is with the user and operator on how to ease the pain point on this.

> May that be advisable to create special commands in glanceclient which either can change state of image or can safely delete image entry in database as a whole?

Image state is a internal to system so, it shouldn't be changed by the user. Hence, there's no functionality for it.
Image DB should not be accessible to the user, as far as the user is concerned they should not know if Glance has a DB or not.

nikhil komawar suggests this article as an answer to your question:

This cannot be Glance's responsibility as what you can boot from is vendor and operator specific things. There is a effort in Glance to add scripts that will enable operators add information on the image to make it boot-able in that deployment. But there cannot be any guarantee on that, also the boot-ablity testing is a NP complete problem to address in any particular one service. The deal is with the user and operator on how to ease the pain point on this.

Image state is a internal to system so, it shouldn't be changed by the user. Hence, there's no functionality for it.

Image DB should not be accessible to the user, as far as the user is concerned they should not know if Glance has a DB or not.

FAQ #2775: “Image boot ability verfication and futher actions”.

Created a FAQ and answered in the comment above.