Declarative incus, thinking aloud

I’m trying to get a sense of all the declarative options for incus, since if I move my oci-stacks out of an instance + quadlet/compose I need them to be easier to manage than manual instance config for each one.

Right now the three I can think of

  1. terraform provider
    This one looks like its the most mature, its maintained by Stephane and seems very trustable!
  2. incus-compose
    maturing, has been brought in as a project, but seems like it’s mostly the work of one guy (thank you!) and his ai. I’m a little nervous about the long term code health, especially since you do have to run a few daemons to use it (currently healthcheck soon dns) especially as the docs for it feel pretty slop-y (the diagrams in the dns image visually do not show what they say they do) testing this option and seeing how I feel right now.
  3. incus-apply
    seems like a simple project, perhaps the lowest barrier to entry and lowest risk, aside from it doesn’t seem to have ongoing development right now.

any other options I should consider before settling on something for the next year or so ?

“ic-healthd” and “ic-dns” both run as oci side car containers, the former for healtchecking and restarts, the later for split dns, both with opt-out.

The docs are 90% written by AI thats right, as well as some of the code, but nearly no code line went in without manual verification, especialy all the ground work on that project is hand work.

Which “image” do you mean? incus-compose/docs/root/dns.md at develop · lxc/incus-compose · GitHub ?


For me each of these projects have different audiences:

  • terraform for large reproducible deployments.
  • incus-compose is OCI only atm. (that might stay as is) and easy to understand as it is a drop-in for docker compose
  • incus-apply the companion to incus-compose for VM’s and LXC’s.

incant https://tracker.debian.org/pkg/incant (follow homepage from that page to get indicator on development status ( and try to see that incant is a mature product ) )

Links to the considered options, for your (and mine) convience

I use the Terraform provider for my Tofu code. The main advantage for me is that I also deploy to AWS, so I can use the same tooling for both environments.

It is maintained by many people and has many contributors. The API is considered stable.

Here are a few notable contributors.

Since we are talking about declarative code, I should also mention that NixOS and Incus go well together. I use it both for my hosts and for my instanceses.

Next version of incus-compose will produce nix2container OCI Containers.

This is my incus deployment r3x/modules/r3x/services/incus.nix at main · jochumdev/r3x · GitHub

I’d probably test the failure cases before committing to one tool for the next year.

Creating a couple of OCI instances from a config file is the easy part. What matters later is what happens when someone changes a network manually, a volume already exists, or you remove a service from the configuration.

Does the tool detect those differences before applying changes? Can it bring an existing instance under management without recreating it? And what happens to persistent storage when an instance is removed?

Since you’re moving from Quadlet/Compose, I’d make a small test stack with persistent data, deliberately change something outside the tool, and then see what the next apply proposes.

I’d try that with Terraform and incus-compose rather than comparing features alone.

The optional sidecars in incus-compose are worth testing too, especially if you don’t need the additional health-check or DNS behavior.

For something I planned to maintain for a year, predictable updates and recovery would matter more to me than how convenient the initial deployment feels.

In general testing the failure cases is ideal, but I think you’re imagining a pretty different workflow with your suggestions than what I’m looking for from the tool. The point of the declarative workflow for me (for this usecase at least) is to end all manual or ‘imperative’ config of these instances.

the instances are disposable. the tool shouldn’t bring any instance under management.Any changes that happen to them outside of the config file are undesired, perhaps even performed by hostile actors.

the point is not ease of initial deployment or I’d only be using compose based tools, the point is that an update is forever possible with a simple destroy and recreate based on new image, with any persistent state clearly separated in it’s own zfs dataset (because of my existing recovery flows)

Regarding incus-apply, your usecase is what I had in mind.

As for the project maintenance, it is still actively maintained. There are no wholesale changes recently as it suffices for me.

I also want to take some time to monitor adoption and gather feedbacks before concluding on a 1.0 release.

Thanks for the input! I’ll give it a shot and see how things work.