Images in state USED but no Templates or VMs use them

Hello Everyone,

we use Ceph as sole datastore for OpenNebula and have a couple of images that we don’t need anymore, but can’t delete because they are in state USED. We have parsed all templates and running VMs, and none of them reference them neither by ID nor name. If we try to delete such an image, Sunstone reports the following error:

[one.image.delete] Cannot delete image. There are 0 VMs using it.

Also oneimage show on the CLI shows no VMs, but some SAVED_ entries in the templates.

Is there any other way those images could somehow be in use, e.g. if they have been cloned, and what are the consequences? Can’t we delete images that have been cloned?

Thanks in advance and greetings
André

Hi @agemuend,
it’s very strange to have image in USED state but 0 VMs using it. If you know how to reproduce this, it would we nice if you make an github issue

The SAVED_ entries indicates, that the image was crated as a copy of existing VM disk. It should not block the delete action.

Cloning images in progress should be in CLONE state, after the cloning is done, they return to READY state and can be deleted.

If you need to delete it, you can manually change the image state by onedb update-body image --id <image_id>
Modify xml atributes:

<STATE>1</STATE>
<RUNNING_VMS>0</RUNNING_VMS>
<VMS/>