You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SBX0: a host boot starts every installed template worker, even under a host agent #796
deploy/sbx/install-host.sh runs systemctl enable sbx-worker@<id>.service for every worker it
installs, and the unit is WantedBy=multi-user.target. So a host boot starts every installed worker.
With the host agent (deploy/sbx/host-agent.sh), which workers run is the control plane's wanted
state: a worker with no lease is in stop. After a boot, the agent's first wanted-state run stops
every worker the boot started and nothing leases. Each of those starts pays a snapshot verify and a
standby pool fill (a pinned memory file read) for nothing, on a disk that a cold start is bound by.
Observed on a KVM host with eight installed workers and a host agent: the boot started all eight; the
agent stopped all eight about 20 s later ("stopped":8). One was stopped mid-fill and leaked a VM
(separate issue).
Proposal
Under a host agent, a worker starts only when the wanted state asks for it:
install-host.sh takes a setting (for example SBX_WORKER_AT_BOOT=0|1), and the host agent's
install sets it to 0: the unit is installed and its first start done as today, but not enabled for
boot (systemctl disable after the start, or never enable). Without a host agent the default
stays 1, as today.
The RUNBOOK says which applies.
What the PR will contain
deploy/sbx/install-host.sh and deploy/sbx/tests/install-host.test.sh (enabled or not, per the
setting; a re-install keeps it).
deploy/sbx/RUNBOOK.md (the host agent section) and deploy/sbx/README.md.
Depends on
The host agent's PR for the agent-managed case.
How to verify
On a KVM host under a host agent: reboot; no worker starts at boot, and the agent starts the leased
ones at its first run.
Limits / out of scope
A host whose control plane is unreachable at boot runs no workers until it is reachable again; that
is the wanted state's model already.
Activity
Merge upstream/main (634781a) into fix/796-worker-at-boot
Merge upstream/main (1016d26) into fix/796-worker-at-boot
feat(sbx): SBX_WORKER_AT_BOOT=0 installs a worker without enabling it…