machine.yaml

A machine spec describes one Ubuntu host. Only four fields are required; everything else has a default. Unknown or wrongly typed fields are refused.

api_version: genesis/v1
machine:
  name: node-a
  address: 203.0.113.10
  ssh:
    key_path: ~/.ssh/id_ed25519
bootstrap:
  deploy_user:
    key_path: ~/.ssh/id_ed25519.pub

Key paths may start with ~/. Paths are on the controller, never on the host.

machine

FieldDefaultRules
name(required)Lowercase DNS-safe label. Unique in the ledger
address(required)Host name or IP that sg SSHes to
ssh.key_path(required)Controller-local SSH private key
ssh.userrootThe bootstrap user
distroubuntu-24.04ubuntu-22.04 or ubuntu-24.04

bootstrap

FieldDefaultRules
packages[fail2ban, unattended-upgrades]Replaces the default list when set. Keep fail2ban: SSH hardening checks its jail
ssh_hardening.password_root_loginfalse
ssh_hardening.password_authenticationfalse
deploy_user.namedeploy
deploy_user.key_pathssh.key_path + .pubController-local public key. Checked before any host contact. A private key here is refused
firewall.guardtrueThe nftables guard in front of LXD
firewall.lxd_api_allow_from[]Individual tailnet IPv4 addresses inside 100.64.0.0/10. No CIDRs. Needs Tailscale enabled
firewall.lxd_api_allow_all_tailnetfalseLet every tailnet client reach the LXD API and UI on :8444. Conflicts with a non-empty allow list. Needs Tailscale enabled
tailscale.enabledtrue
tailscale.auth_key_envTS_AUTHKEYThe name of the variable holding the auth key. Required while Tailscale is enabled. plan refuses if it's unset or empty

lxd

FieldDefaultRules
channel5.21/stableSnap channel. Held, so it doesn't move under you. Cluster members must match
api_addresstailnet:8444One concrete address with a port. Never port 8443, a wildcard or loopback
storage.driverzfszfs, btrfs or dir
storage.pool_file_size150GiBNGiB or NMiB. A sparse file on the root disk. Grows, never shrinks
storage.arc_max4GiBZFS memory cache cap
network.bridgelxdbr0A valid interface name, at most 15 characters
network.subnetpicked once before planningA CIDR like 10.81.0.1/24. Must avoid 172.16.0.0/12 and 100.64.0.0/10. A clash with an existing bridge is refused, never renumbered
network.nattrue
network.ipv6noneMust be none while the guard is on
profilesdefault, and task-vm with 2 CPU and 4GiBUnique, non-empty names. Each may set cpu and memory

What sg checks before contacting the host

  • api_version is exactly genesis/v1.
  • Names are valid labels; the distro is a supported LTS.
  • The deploy key is a readable public key, not the private one.
  • The LXD API address isn't 8443, a wildcard or loopback.
  • Allow-list entries are single tailnet addresses, and Tailscale is on if any are set.
  • Sizes parse, the subnet avoids reserved ranges, and IPv6 is off under the guard.

A refusal names the field and the rule, for example:

sg machine init: loading spec: machine.name "node-a": lxd.api_address "tailnet:8443": lxd.api_address must never use port 8443