Deleting an image on RDO

So I uploaded a qcow image…but did it wrong. It was tagged as raw instead of qcow, and now I want it gone. Only problem….it is stuck.

$ openstack image delete rhel-server-7.4-update-4-x86_64
Failed to delete image with name or ID 'rhel-server-7.4-update-4-x86_64': 409 Conflict
Image 2e77971e-7746-4992-8e1e-7ce1be8528f8 could not be deleted because it is in use: The image cannot be deleted because it is in use through the backend store outside of Glance.

But….I deleted all of the instances connected to it! Come On!

Answer is easy once the code-rage wears off…

When I created a server based on this image, it created a new volume. That volume is locking the image into place.

$ openstack volume list
| ID                                   | Name | Status    | Size | Attached to                      |
| 97a15e9c-2744-4f31-95f3-a13603e49b6d |      | error     |    1 |                                  |
| c9337612-8317-425f-b313-f8ba9336f1cc |      | available |    1 |                                  |
| 9560a18f-bfeb-4964-9785-6e76fa720892 |      | in-use    |    9 | Attached to showoff on /dev/vda  |
| 0188edd7-7e91-4a80-a764-50d47bba9978 |      | in-use    |    9 | Attached to test1 on /dev/vda    |

See that error? I think its that one. I can’t confirm now, as I also deleted the available one, as I didn’t need it, either.

$ openstack volume delete 97a15e9c-2744-4f31-95f3-a13603e49b6d
$ openstack volume delete c9337612-8317-425f-b313-f8ba9336f1cc
$ openstack image delete rhel-server-7.4-update-4-x86_64

And that last command succeeded.

$ openstack image show  rhel-server-7.4-update-4-x86_64
Could not find resource rhel-server-7.4-update-4-x86_64

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.