In-use OCI images disappeared from `incus image ls`

Hi everyone,

I noticed that one of my OCI containers was outdated and used incus image ls to verify when its base image was last updated. Then I found out that its base image disappeared - incus image ls showed the OCI image of a different container created a few days ago but not this older one. I checked the instance configuration’s volatile.base_image and did an incus image info on the hash but it just gave me Image ... not found.

I thought that incus actually updates these OCI images that are being used via an alias (like eg.docker.io/postgres:18-alpine but if incus didn’t even keep the image, it surely isn’t updating it?

Please help me understand what is happening here, thanks in advance :slight_smile:

The local image server stores images for up to 10 days since last use.
Those images also auto-update during those 10 days, so the particular hash you have recorded on the container will quickly go away from the local cache.

Hi Stéphane, thank you for your response!

Okay what you describe is what I would expect too, depending on interpretation. Does “since last use” mean since last instance creation or since the last instance based on this image was running?

I would personally expect this behaviour:

  • instance is created based on image X v1
  • image X is updated to v2
  • image X v1 is still in use at this point (is this where I am wrong?)
  • instance is restarted
  • now image X v1 is not in use anymore, image X v2 is in use
  • image X v1 is deleted after 10 days (by default)
  • image X v2 is kept since it is in use and should appear in incus image ls

Where am I wrong here? Clearly there was some point in time where the image was considered not in use and deleted after a period of 10 days, but no newer version directly replaced it either. The scenario I find myself in seems like it should be impossible, since I have OCI instances running for which no image exists in incus image ls.