Should `incus create` read more fields from YAML input?

Hi,

I’ve been trying to create instances declaratively using YAML files with incus create, but I noticed that only some fields are read from the YAML input.

When running:

sudo incus create my-container-image container-name < config.yaml

Some fields are read from YAML:

  • config

  • profiles (unless -p or --no-profiles flags are used)

  • devices

  • description (unless --description flag is used)

But others like ephemeral (requires –ephemeral flag) and stateful are not.

Sources:

Is this the expected behavior? If so, is there a design reason why those fields aren’t read from YAML? Would supporting this be a welcome feature request? Maybe a separate command for full declarative instance management could be interesting, similar to kubectl apply -f, or that is not the goal?

Stateful isn’t really something you’re supposed to write to, it’s basically a read-only property the server sets if there is runtime state on disk that can be restored.

Ephemeral looks like a bug though, we should only override it if the CLI flag is actually passed.

In general, if you want fully declarative instance management, I’d recommend looking at the Terraform provider for Incus.

1 Like
1 Like

wow blazing fast fix!! thank you so much