Skip to content

Hosts

A host runs agent machines. Hosts are cluster nodes with the worker role (either worker-only or converged with controlplane).

nodes/w1.toml
[node]
name = "w1"
roles = ["worker"] # or ["controlplane", "worker"]
install_disk = "/dev/disk/by-id/nvme-…"
[node.worker]
max_cpu = "90%" # percentage or CPU count
max_memory = "85%" # percentage or size, e.g. "48GiB"
vm_disk = "/dev/disk/by-id/nvme-…" # dedicated disk for machine disks and saved state
taints = ["gpu:dedicated"] # optional
Key Meaning
max_cpu, max_memory Total cap for all machines on the host (also enforced on workloads.slice). Unset defaults to everything left after Postgres and 2 GiB for the OS.
vm_disk Dedicated disk for VM state (formatted if empty). Without it, machines share a disk image taking half the install disk. Required on multi-node converged nodes.
taints Only machines with matching tolerations schedule here.

Nodes refuse worker configs if /dev/kvm is missing or if max_memory plus Postgres leaves less than 2 GiB for the OS. Updates to [node.worker] apply live—hostagent restarts while existing machines keep running.

  1. Write nodes/w1.toml as above, setting [node.iroh] relay_url to one of your control-plane nodes’ relays so the worker can always reach the control plane even without a direct UDP path.
  2. Boot it from the installer and install it:
    Terminal window
    anastroctl cluster apply -n w1 --maintenance <ticket>
  3. Paste the printed node entry into your client file, then apply the cluster so control-plane nodes trust the new worker’s endpoint:
    Terminal window
    anastroctl cluster apply
  4. Confirm it registered with anastroctl cluster host list.

Worker-only nodes don’t run Postgres or apid and accept only operator keys on their node API—pass --as-operator when querying them (e.g. anastroctl node status -n w1 --as-operator).

Machines can request named worker capabilities (--capability gpu:cuda, usb:lab), and the scheduler only places them on hosts advertising every requested capability. Projects can set machine defaults that individual machines can override.

PCI passthrough requires a dedicated Linux worker (not a converged node). Enable IOMMU in firmware and Linux, bind every device in the target IOMMU group to vfio-pci before hostagent starts, and map capabilities to their sysfs PCI paths:

[node.worker.devices]
"gpu:cuda" = "/sys/bus/pci/devices/0000:01:00.0"
"usb:lab" = "/sys/bus/pci/devices/0000:02:00.0"

Use your actual host PCI addresses. Notes:

  • GPU and USB capabilities must be declared under [node.worker.devices] (not just listed in node.worker.capabilities).
  • USB passthrough assigns an entire PCI USB controller—individual /dev/bus/usb paths are refused.
  • Assigned devices stay reserved exclusively, even while a failed machine waits to retry.
  • GPU machines need a Nix guest image containing matching drivers.
  • Device-backed machines cannot live-move or save VM memory across host restarts.

Among hosts that match a machine’s capabilities, tolerations, and resource limits, the scheduler prefers:

  1. Dedicated workers over converged nodes.
  2. Hosts that already have the machine’s environment cached.
  3. The host with the most free memory.

Whenever at least one dedicated worker exists, converged nodes automatically carry the controlplane:trusted-only taint; machines only schedule there with --toleration controlplane:trusted-only.

Terminal window
anastroctl cluster host list # hosts, status, and resource usage
anastroctl cluster host cordon w1 # stop placing new machines on w1
anastroctl cluster host uncordon w1
anastroctl cluster host drain w1 # cordon and live-move all machines off w1
anastroctl cluster host rebalance # spread running machines evenly with live moves

By default, drain live-moves machines off the host a few at a time without interrupting them. If a machine cannot live-move, the drain waits rather than stopping it unless you pass a flag:

Flag Behavior
--graceful Checkpoint, stop, and cold-boot machines on another host instead of live-moving
--allow-stop Move non-migratable machines gracefully; stop machines that don’t fit anywhere (they resume on next use)
--no-wait Trigger moves and return immediately
--timeout <seconds> Max wait time (default 1800)

cluster apply --reboot, cluster upgrade, and node reset drain workers automatically before rebooting and uncordon them once healthy, using [machines.drain]:

[machines.drain]
parallel = 2 # concurrent live moves per host
max_pause = "1s" # max freeze time during a live move
timeout = "30m" # fail rollout if machines remain after this
on_no_capacity = "wait" # or "stop" to stop machines that can't fit
rebalance = true # rebalance hosts after a rollout

On a single-host cluster, running machines pause and save to vm_disk across reboots instead of moving. A machine with no workspace cannot move and blocks drains.

Drain the host, then remove its enrollment as a cluster admin (or use Fleet in the UI):

Terminal window
anastroctl cluster host drain w1
anastroctl cluster host remove w1

Removal fails safely if the host still has running machines, active moves, unexpired filesystem leases, or unuploaded workspace checkpoints. Once the runner stops and leases clear:

  • Pass --detach-stopped if stopped DWFS machines remain on the host and their latest checkpoints are already Portable—they will resume on other hosts next time they’re used.
  • Any machine whose files live only on the host’s local disk must be migrated or explicitly deleted first.

Removal revokes the host’s filesystem grants and agent enrollment so old signed configs can’t re-register it (re-admit later with anastroctl cluster host admit w1). Removing a converged node’s worker enrollment leaves its control-plane, Postgres, and etcd membership intact.

Resource Across a live move
Running processes, memory, open files Preserved (pauses briefly, within max_pause)
Active commands and terminals Preserved seamlessly
Machine IP and inbound traffic Preserved
Workspace (including excluded paths like node_modules/, target/) Preserved
Unlinked (deleted-while-open) workspace files Lost—open readers get errors after the move
Outbound TCP connections Reset (retry-capable clients like git and package managers recover automatically)

Live moves require hosts in the same migration group (matching CPU architecture, model, and features) and never move to a host running an older Cloud Hypervisor.

Networking.