fix(incus-vm): tie boot.autostart to workspace start_count

VMs were unconditionally set to boot.autostart=true, meaning after a
host reboot all VMs (including stopped workspaces) would come back up.
With 18 VMs auto-starting, dnsmasq hit its 150 concurrent DNS query
limit, cascading into incus.service failures and a watchdog reboot.

Now boot.autostart mirrors the workspace state so stopped workspaces
stay stopped across host reboots.
This commit is contained in:
Ben Potter 2026-04-24 13:46:12 +00:00
parent c86793f43c
commit cd76e01fa2

View File

@ -257,7 +257,7 @@ resource "incus_instance" "dev" {
free-page-reporting = "on"
QEMUCONF
"security.secureboot" = false
"boot.autostart" = true
"boot.autostart" = data.coder_workspace.me.start_count == 1
"user.coder-agent-token" = local.agent_token
},
local.is_nixos ? {} : {