Configure instance startup retries & delays between startup retries

I’m running into an issue where on reboot instances sometimes fail to start because a mount isn’t available:

level=warning msg="Failed auto start instance attempt" attempt=3 err="Failed to start device \"data\": Failed accessing source path \"/home/adgh/containers/adgh\": stat /home/adgh/containers/adgh: no such file or directory" instance=adgh maxAttempts=3 project=default

For context /home/adgh/containers/adgh is a symlink to a data folder (also on device) but doesn’t seem to be immediately accessible. (not sure why it takes so long for on-device symlinks to become live, but w/e)

I worked around the issue with Podman by taking advantage of the Quadlet systemd integration by specifying RestartSec=5 and the default systemd retry number of 5 seems to be enough.

I see from the logs that Incus’ delay between retries is 5 seconds, but it only tries 3 times (per the maxAttempts=3 and the last log entry says attempt=3).

I cannot see in the docs how to specify a higher maxAttempts or a higher time between start up attempts. Based off of systemd, the mount should be live by 20 seconds, so if I can tell it to try till then, that would fix it :\)

Final context, I have these boot settings set:

  boot.autorestart: "true"
  boot.autostart: "true"
  boot.autostart.priority: "1"

I’d happily take setting boot.autostart to use boot.autorestart’s “10 tries in 1 minute” per Instance options - Incus documentation

Thanks! I’ve been using Incus for quite a while and it is very reliable, knowing this bit will make it perfect (for me at least!)

Is the only solution to make a systemd watcher to make this start reliably? Or is there a way to tell Incus to wait for the symlink’d volumes to become ready like systemd can do?

It seems too odd that startup stuff is so barebones in Incus, as that should be a common function for containers to do. I must be missing how to configure it, but I just can’t find anything in the docs.

If someone knows the right names of settings - let me know! Otherwise I’ll just have to make a bespoke script for the container like the olden days.