How to recreate an instance upon new available image?

Hi,

I have a workflow that consists of this, using the terraform provider:

  • start system containers that start OCI containers with podman
  • OCI containers storage is on a dedicated incus volume that is marked prevent_destroy = true in terraform
  • I want to destroy and recreate the instance using a newer base image instead of having to manage all the system containers and keep them up to date

So far, I don’t really understand how the images are working, how to use aliases and the auto update system. Here is a trimmed down terraform code for a single instance

resource "incus_image" "ubuntu_test" {
  source_image = {
    remote = "images"
    name   = "ubuntu/questing/cloud"
    type   = "container"
  }
}

resource "incus_instance" "restic" {
  name  = "restic"
  image = incus_image.ubuntu_test.fingerprint
  ephemeral = false

  lifecycle {
    replace_triggered_by = [
      incus_image.ubuntu_test.fingerprint
    ]
  }

}

So I don’t really understand how to pick the fingerprint of the newest image ubuntu/questing/cloud

I see I have 2 images now, the newest got automatically created by incus (running on incus os) and I’m not sure how because the other image is not set to auto update, all my instances are using the oldest image ab7930808f28

+-------+--------------+--------+----------------------------------------+--------------+-----------+-----------+-----------------------+
| ALIAS | FINGERPRINT  | PUBLIC |              DESCRIPTION               | ARCHITECTURE |   TYPE    |   SIZE    |      UPLOAD DATE      |
+-------+--------------+--------+----------------------------------------+--------------+-----------+-----------+-----------------------+
|       | a079b79902e4 | no     | Ubuntu questing amd64 (20260405_07:42) | x86_64       | CONTAINER | 157.77MiB | 2026/04/05 15:12 CEST |
+-------+--------------+--------+----------------------------------------+--------------+-----------+-----------+-----------------------+
|       | ab7930808f28 | no     | Ubuntu questing amd64 (20260404_07:42) | x86_64       | CONTAINER | 157.77MiB | 2026/04/04 17:43 CEST |
+-------+--------------+--------+----------------------------------------+--------------+-----------+-----------+-----------------------+
 

Any clue on this? In my current state, I need somehow to have terraform figuring the current base image of the instances is ab7930808f28 and that it should destroy and start them with a079b79902e4