Tarsana docsDashboardMenu

Run it on your provider

In this quickstart you store your Hetzner Cloud API token in Tarsana and create a server from your spec in your own Hetzner Cloud project.

Before you start, finish Build your first image. With the API you need the shell variables from it: TENANT, ACCESS_TOKEN and SUBMISSION. In the portal you need to be signed in, and over MCP your agent needs to be connected. Creating and removing servers needs the deployer role, which you have as the owner of your tenant.

1. Create an API token at Hetzner

In the Hetzner Cloud Console, open the project the server should run in, go to Security, then API tokens, and create a token with Read & Write permission. Copy it.

export HCLOUD_TOKEN=paste-your-hetzner-api-token

2. Store it in Tarsana

Tarsana stores the token encrypted for your tenant only and never shows it again.

API

Send the token to set-provider-credential:

curl -X POST "https://api.tarsana.io/v1/tenants/$TENANT/providers/hetzner/credential" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT" \
  -H "Content-Type: application/json" \
  --data "{\"provider_token\": \"$HCLOUD_TOKEN\"}"

If it worked, you see its fingerprint:

{
  "credential_set": true,
  "fingerprint": "sha256:15dedf1c99544c41",
  "set_at": "2026-10-05T02:15:40.551914Z",
  "replaced": false
}

Portal

On your dashboard, under Your cloud provider, choose Add your provider credential. The form Store or replace your provider credential opens with tenant and provider_name filled in. Paste the token into provider_token and press Send. Back on the dashboard, the panel shows the token's Fingerprint.

MCP

Ask your agent, and give it the token:

Your agent calls the set-provider-credential tool:

{
  "method": "tools/call",
  "params": {
    "name": "set-provider-credential",
    "arguments": {
      "tenant": "acme",
      "provider_name": "hetzner",
      "provider_token": "YOUR-HETZNER-TOKEN"
    }
  }
}

The token then passes through your agent and stays in its chat history. If you would rather it did not, store it with the API or in the portal.

The fingerprint is sha256: followed by the first 16 hex digits of the SHA-256 of your token. Check it against your own copy:

printf %s "$HCLOUD_TOKEN" | sha256sum | cut -c1-16

3. Check where the server will run

The placement in your spec says where: provider is hetzner-cloud, server_type is a Hetzner server type, and region is optional (see placement in the Spec reference). The spec from the first quickstart already has one:

"placement": {"provider": "hetzner-cloud", "server_type": "cpx12", "region": "nbg1"}

The placement is not part of the spec's hash, and Tarsana keeps the placement of the first submission of a spec. If you submitted a spec without a placement, adding one does not change the stored submission: change something else in the spec as well, so that it gets a new submission ID, and submit it. A placement Tarsana cannot use is refused at submission with spec_invalid, together with the providers you can use.

The image from the first quickstart has no kernel of its own. For a server that installs the image on its own disk and boots it, build the bootable-node spec instead: the same Ubuntu base plus a kernel and the tools it boots with, and what Tarsana's update agent needs on the server to keep it up to date (its files are shown with what each one does in the Spec reference). Its package list is already reviewed, and every build of it is checked against that list, so change only metadata (your own tenant ID) and, if you like, placement:

{
  "schema_version": "2.0",
  "metadata": {"name": "bootable-node", "tenant": "acme"},
  "distro": "ubuntu",
  "snapshot_id": "20260715T000000Z",
  "base_ref": "noble",
  "hardening_profile": "tarsana-baseline",
  "policy_class": "baseline",
  "packages": ["linux-image-virtual", "initramfs-tools", "cryptsetup-bin", "systemd-sysv", "curl", "dmsetup"],
  "files": [
    {"path": "/etc/fstab", "mode": "0644", "content": "/dev/mapper/tarsana-root  /  ext4  ro  0  1\nLABEL=tarsana-state  /var/lib/tarsana-state  ext4  rw,nosuid,nodev,noexec,nofail  0  2\n"},
    {"path": "/usr/local/sbin/tarsana-boot-ok", "mode": "0755", "content": "#!/bin/sh\n# Tarsana: the OS health assertion -- what the chooser's tries-left counter waits for.\n# Owner: Q3 (boot/CONTRACT.md §4, boot/os/; X330, D75 Q3 = 3B, X250 §4).\n# Installed as /usr/local/sbin/tarsana-boot-ok by specs/roles/{worker,control}.yaml (boot/os/MANIFEST).\n#\n# Writes boot_ok=1 and boot_pending=0 on the state partition -- exactly those two markers and\n# nothing else (CONTRACT §6.1) -- when ALL of these hold:\n#   state   the state partition is mounted at /var/lib/tarsana-state (where the markers live);\n#   verity  root IS the dm-verity device tarsana-root, the kernel reports it verified, and its\n#           root hash is the one the chooser put on the command line (tarsana.verity_roothash=);\n#   units   every unit /etc/tarsana/boot-required.services names is active (D64 §6: the SPEC is\n#           the authority on whether a boot is ok). The role specs name the update agent there:\n#           a node that boots but can never be updated again has no remote remedy. An absent list\n#           is REFUSED, never read as an empty one;\n#   ident   the node identity the agent uses is held: client.crt and client.key on the state\n#           partition parse and belong together.\n# Nothing here depends on the network being up now: an assertion that did would roll healthy nodes\n# back during an image-server outage, fleet-wide (X250 §4).\n#\n# Then the boot deadline is disarmed (tarsana-boot-watchdog disarm). When the checks have not all\n# passed after BOOT_OK_WAIT seconds, NOTHING is written: stage-1 has already counted this boot, and\n# the armed deadline reboots the node into the chooser, which counts the next one.\n# Exit: 0 asserted; 1 not asserted (the reasons are on stdout and in the journal).\nset -u\nS=/var/lib/tarsana-state\nREQUIRED=/etc/tarsana/boot-required.services\nVERITY_NAME=tarsana-root\nBOOT_OK_WAIT=120\n\nsay() { echo \"[tarsana] boot_ok: $*\"; }\n\ncheck_state() {\n  mountpoint -q \"$S\" || { WHY=\"state partition not mounted at $S\"; return 1; }\n}\n\ncheck_verity() {\n  want=\"\"\n  # shellcheck disable=SC2013  # the command line is words\n  for tok in $(cat /proc/cmdline); do\n    case \"$tok\" in tarsana.verity_roothash=*) want=\"${tok#tarsana.verity_roothash=}\" ;; esac\n  done\n  [ -n \"$want\" ] || { WHY=\"no tarsana.verity_roothash on the command line: booted without verity\"; return 1; }\n  src=\"$(findmnt -no SOURCE / 2>/dev/null)\"\n  [ \"$src\" = \"/dev/mapper/$VERITY_NAME\" ] || { WHY=\"root is '${src:-?}', not /dev/mapper/$VERITY_NAME\"; return 1; }\n  if command -v veritysetup >/dev/null 2>&1; then\n    st=\"$(veritysetup status \"$VERITY_NAME\" 2>/dev/null)\" || { WHY=\"veritysetup status $VERITY_NAME failed\"; return 1; }\n    vstatus=\"$(printf '%s\\n' \"$st\" | sed -n 's/^ *status: *//p' | head -1)\"\n    have=\"$(printf '%s\\n' \"$st\" | sed -n 's/^ *root hash: *//p' | head -1 | tr 'A-F' 'a-f')\"\n  else\n    # X334: the factory removes veritysetup from every image's root (stages/build/lib/boot.sh,\n    # boot_purge_veritysetup), so on a factory image the kernel's own table is read with dmsetup:\n    #   table   0 <len> verity <ver> <data> <hash> <dbs> <hbs> <blocks> <hash start> <alg> <ROOT> <salt> ...\n    #   status  0 <len> verity V (verified) | C (corruption detected)\n    command -v dmsetup >/dev/null 2>&1 || { WHY=\"neither veritysetup nor dmsetup is in this image\"; return 1; }\n    tbl=\"$(dmsetup table \"$VERITY_NAME\" 2>/dev/null)\" || { WHY=\"dmsetup table $VERITY_NAME failed\"; return 1; }\n    dst=\"$(dmsetup status \"$VERITY_NAME\" 2>/dev/null)\" || { WHY=\"dmsetup status $VERITY_NAME failed\"; return 1; }\n    # shellcheck disable=SC2086  # the table and the status are words\n    set -- $tbl\n    if [ \"${3:-}\" != verity ] || [ \"$#\" -lt 13 ]; then WHY=\"$VERITY_NAME is not a dm-verity table ('${3:-?}')\"; return 1; fi\n    have=\"$(printf '%s' \"${12}\" | tr 'A-F' 'a-f')\"\n    # shellcheck disable=SC2086\n    set -- $dst\n    case \"${3:-}:${4:-}\" in\n      verity:V) vstatus=verified ;;\n      verity:C) vstatus=corrupted ;;\n      *) vstatus=\"${3:-}:${4:-}\" ;;\n    esac\n  fi\n  case \"$vstatus\" in verified*) ;; *) WHY=\"verity status is '${vstatus:-?}', not verified\"; return 1 ;; esac\n  want=\"$(printf '%s' \"$want\" | tr 'A-F' 'a-f')\"\n  if [ -z \"$have\" ] || [ \"$have\" != \"$want\" ]; then\n    WHY=\"running root hash '${have:-?}' is not the command line's '$want'\"; return 1\n  fi\n}\n\ncheck_units() {\n  [ -f \"$REQUIRED\" ] || { WHY=\"$REQUIRED is absent: cannot tell which units the spec requires\"; return 1; }\n  [ -r \"$REQUIRED\" ] || { WHY=\"$REQUIRED is unreadable\"; return 1; }\n  down=\"\"\n  while IFS= read -r unit || [ -n \"$unit\" ]; do\n    case \"$unit\" in ''|'#'*) continue ;; esac\n    ustate=\"$(systemctl is-active \"$unit\" 2>/dev/null)\"\n    [ \"$ustate\" = active ] || down=\"$down $unit=${ustate:-unknown}\"\n  done < \"$REQUIRED\"\n  [ -z \"$down\" ] || { WHY=\"required units not active:$down\"; return 1; }\n}\n\ncheck_ident() {\n  crt=\"$S/tarsana/pki/client.crt\"; key=\"$S/tarsana/pki/client.key\"\n  a=\"$(openssl x509 -in \"$crt\" -noout -pubkey 2>/dev/null)\" || { WHY=\"node identity $crt does not parse\"; return 1; }\n  b=\"$(openssl pkey -in \"$key\" -pubout 2>/dev/null)\" || { WHY=\"node identity $key does not parse\"; return 1; }\n  if [ -z \"$a\" ] || [ \"$a\" != \"$b\" ]; then WHY=\"node identity: $key is not the key of $crt\"; return 1; fi\n}\n\nwaited=0\nwhile :; do\n  WHY=\"\"\n  if check_state && check_verity && check_units && check_ident; then break; fi\n  if [ \"$waited\" -ge \"$BOOT_OK_WAIT\" ]; then\n    say \"NOT asserted after ${waited}s: $WHY\"\n    say \"nothing written; the boot deadline brings this node back to the chooser, which counts it\"\n    exit 1\n  fi\n  sleep 2; waited=$((waited + 2))\ndone\n\nmkdir -p \"$S/tarsana\"\nprintf 1 > \"$S/tarsana/boot_ok\"\nprintf 0 > \"$S/tarsana/boot_pending\"\nsync\nsay \"asserted after ${waited}s (state, verity, units, identity): boot_ok=1 on $S\"\n/usr/local/sbin/tarsana-boot-watchdog disarm || say \"the boot deadline could not be disarmed (see above)\"\nexit 0\n"},
    {"path": "/etc/systemd/system/tarsana-boot-ok.service", "mode": "0644", "content": "[Unit]\nDescription=Tarsana: OS health assertion -- boot_ok for the chooser's tries-left counter (X330)\nRequiresMountsFor=/var/lib/tarsana-state\n# X334: NO After=multi-user.target. The target Wants this unit (50-tarsana-boot-ok.conf), so it is\n# already ordered After= it by default; the two together are an ordering cycle and systemd breaks it\n# by deleting this unit's start job (measured under KVM: the assertion never ran). The script waits\n# up to BOOT_OK_WAIT for the units it checks, so it needs no ordering of its own.\n[Service]\nType=oneshot\nExecStart=/usr/local/sbin/tarsana-boot-ok\nRemainAfterExit=yes\n[Install]\nWantedBy=multi-user.target\n"},
    {"path": "/etc/systemd/system/multi-user.target.d/50-tarsana-boot-ok.conf", "mode": "0644", "content": "# X330: pulls the OS health assertion into every boot. A drop-in, because the spec path writes\n# files and enables no node unit (its [Install] section alone would never run it).\n[Unit]\nWants=tarsana-boot-ok.service\n"},
    {"path": "/etc/tarsana/boot-required.services", "mode": "0644", "content": "# Units that must be active for this OS to assert boot_ok (D64 §6: the spec is the authority).\n# Read by /usr/local/sbin/tarsana-boot-ok. The update agent (Q2's boot/agent/agent.sh): a node that\n# boots but can never be updated again has no remote remedy (X250 §4 (b)).\ntarsana-agent.service\n"},
    {"path": "/usr/local/sbin/tarsana-boot-watchdog", "mode": "0755", "content": "#!/bin/sh\n# Tarsana: the boot deadline -- softdog armed early, until the OS health assertion disarms it.\n# Owner: Q3 (boot/CONTRACT.md §4, boot/os/; X330, D75 Q3 = 3B with 3C's softdog, X250 §4).\n# Installed as /usr/local/sbin/tarsana-boot-watchdog by specs/roles/{worker,control}.yaml.\n#\n#     tarsana-boot-watchdog arm      # tarsana-boot-watchdog.service, before sysinit.target\n#     tarsana-boot-watchdog disarm   # tarsana-boot-ok, once it has written boot_ok=1\n#\n# panic= brings a PANICKING kernel back to the chooser; nothing brings back a userspace that\n# hangs before the assertion. So the watchdog is opened and closed WITHOUT the magic 'V': it keeps\n# running, nobody feeds it, and BOOT_DEADLINE seconds later it reboots the node into the chooser,\n# which counts the boot (tries_left_<S>). The assertion stops it with the magic close and puts\n# back the device's own timeout, so whatever uses the watchdog later (medik8s self-node-remediation\n# on the role images) finds it as it was.\n# Never arms a deadline it could not take back: with nowayout set, magic close cannot stop it,\n# and every HEALTHY node would reboot every BOOT_DEADLINE seconds. Exit 0 always -- a boot is\n# never held up by this script; what it could not do it says.\nset -u\nDEV=/dev/watchdog\nSYS=/sys/class/watchdog/watchdog0\nSAVE=/run/tarsana-boot-watchdog.timeout\nBOOT_DEADLINE=900\n\nsay() { echo \"[tarsana] boot deadline: $*\"; }\n\narm() {\n  [ -c \"$DEV\" ] || modprobe softdog 2>/dev/null\n  n=0\n  while [ ! -c \"$DEV\" ] && [ \"$n\" -lt 5 ]; do sleep 1; n=$((n + 1)); done\n  [ -c \"$DEV\" ] || { say \"NOT armed: no $DEV (softdog did not load)\"; return 0; }\n  nwo=\"$(cat \"$SYS/nowayout\" 2>/dev/null)\"\n  [ \"$nwo\" = 0 ] || { say \"NOT armed: nowayout is '${nwo:-unreadable}', a deadline that cannot be stopped would reboot healthy nodes\"; return 0; }\n  cat \"$SYS/timeout\" > \"$SAVE\" 2>/dev/null || :\n  wdctl -s \"$BOOT_DEADLINE\" \"$DEV\" >/dev/null 2>&1 || { say \"NOT armed: wdctl could not set ${BOOT_DEADLINE}s on $DEV\"; return 0; }\n  # open and close without 'V': the watchdog stays running and nobody feeds it\n  if ! true 2>/dev/null > \"$DEV\"; then say \"NOT armed: cannot open $DEV\"; return 0; fi\n  say \"armed: ${BOOT_DEADLINE}s on $DEV ($(cat \"$SYS/identity\" 2>/dev/null)), state $(cat \"$SYS/state\" 2>/dev/null)\"\n}\n\ndisarm() {\n  [ -c \"$DEV\" ] || { say \"nothing to disarm: no $DEV\"; return 0; }\n  # magic close: open, 'V', close -> stopped (nowayout was checked when it was armed)\n  if ! printf V 2>/dev/null > \"$DEV\"; then say \"could NOT disarm: $DEV is busy or unwritable\"; return 0; fi\n  orig=\"$(cat \"$SAVE\" 2>/dev/null)\"\n  if [ -n \"$orig\" ]; then wdctl -s \"$orig\" \"$DEV\" >/dev/null 2>&1 || say \"could not restore the timeout to ${orig}s\"; fi\n  say \"disarmed, state $(cat \"$SYS/state\" 2>/dev/null)\"\n}\n\ncase \"${1:-}\" in\n  arm) arm ;;\n  disarm) disarm ;;\n  *) echo \"usage: $0 arm|disarm\" >&2; exit 2 ;;\nesac\nexit 0\n"},
    {"path": "/etc/systemd/system/tarsana-boot-watchdog.service", "mode": "0644", "content": "[Unit]\nDescription=Tarsana: boot deadline -- softdog armed until the OS health assertion (X330)\nDefaultDependencies=no\nAfter=systemd-modules-load.service\nBefore=sysinit.target shutdown.target\nConflicts=shutdown.target\n[Service]\nType=oneshot\nExecStart=/usr/local/sbin/tarsana-boot-watchdog arm\nExecStop=/usr/local/sbin/tarsana-boot-watchdog disarm\nRemainAfterExit=yes\n[Install]\nWantedBy=sysinit.target\n"},
    {"path": "/etc/systemd/system/sysinit.target.d/50-tarsana-boot-watchdog.conf", "mode": "0644", "content": "# X330: pulls the boot deadline into every boot, before sysinit.target. A drop-in, because the\n# spec path writes files and enables no node unit.\n[Unit]\nWants=tarsana-boot-watchdog.service\n"},
    {"path": "/usr/lib/sysctl.d/90-tarsana-panic.conf", "mode": "0644", "content": "# X330: the image's own copy of PANIC_ARGS (boot/stage1/lib/panic.sh), so a panic, an oops or a\n# soft lockup reboots into the chooser even if a command line lost them. Shipped in the VENDOR\n# directory /usr/lib/sysctl.d: /etc/sysctl.d/ is the hardening layer's (content/layers/reserved-paths.tsv),\n# and a node layer writing there is refused at assembly (X334).\nkernel.panic = 10\nkernel.panic_on_oops = 1\nkernel.softlockup_panic = 1\n"},
    {"path": "/usr/local/sbin/tarsana-node-network", "mode": "0755", "content": "#!/bin/sh\n# Tarsana: the OS's network, as route 3's takeover captured it -- so the update agent can fetch and\n# report from the running OS (X418, F-526). Installed as /usr/local/sbin/tarsana-node-network by\n# specs/examples/bootable-node.yaml (content/os-network/MANIFEST).\n#\n# Stage-1 (X333, boot/stage1/lib/net.sh) keeps the network the install script captured from the\n# provider's stock OS on the state partition, and brings it up itself at every boot:\n#   tarsana/net/mac    the NIC, by MAC                 tarsana/node_cidr   its address, a.b.c.d/n\n#   tarsana/node_gw    the gateway (may be off-prefix) tarsana/net/dns     a,b,... (may be absent)\n# These are the values nodecfg_captured_netplan renders as netplan for an OS that carries netplan.io;\n# this OS does not (netplan.io would bring python3 into a minimal image), so they are rendered here\n# for systemd-networkd, which is in the image's own systemd:\n#   /run/systemd/network/10-tarsana-node.network   the address on the NIC with that MAC, and the\n#                                                  default route through the gateway ON-LINK (Hetzner\n#                                                  Cloud hands out a /32 whose gateway sits outside it)\n#   /run/tarsana-net/resolv.conf                   the captured resolvers, bind-mounted over\n#                                                  /etc/resolv.conf (the root is read-only)\n# p4 is OS-writable, so every value is checked for its shape first and NOTHING is written from a\n# value that is not one; a node without a captured network gets none (the chain's own network is\n# stage-1's, not this OS's). Nothing here is a security boundary: what the agent fetches is\n# verified, and the transport's CA comes from stage-1 (content/agent/tarsana-agent).\n#\n# Exit: 0 written; 1 not written (the reason is on stdout and in the journal).\nset -u\nS=\"${TARSANA_NET_STATE:-/var/lib/tarsana-state}\"\nNETWORK_DIR=\"${TARSANA_NET_NETWORKD:-/run/systemd/network}\"\nRUN=\"${TARSANA_NET_RUN:-/run/tarsana-net}\"\nRESOLV=\"${TARSANA_NET_RESOLV:-/etc/resolv.conf}\"\nUNIT=10-tarsana-node.network\n\nsay() { echo \"[tarsana] node network: $*\"; }\nrefuse() { say \"NOT configured: $*\"; exit 1; }\n\n# An IPv4 address in dotted quad, every octet 0-255 and written without a leading zero.\nipv4() {\n  case \"$1\" in ''|*[!0-9.]*|.*|*.|*..*) return 1 ;; esac\n  _ip_old=$IFS; IFS=.\n  # shellcheck disable=SC2086  # the address is split into its octets on purpose\n  set -- $1\n  IFS=$_ip_old\n  [ \"$#\" -eq 4 ] || return 1\n  for _ip_o in \"$@\"; do\n    case \"$_ip_o\" in 0) ;; 0*|????*) return 1 ;; esac\n    [ \"$_ip_o\" -le 255 ] || return 1\n  done\n}\n\nvalue() { cat \"$S/tarsana/$1\" 2>/dev/null; }\n\nmountpoint -q \"$S\" || refuse \"the state partition is not mounted at $S\"\nMAC=\"$(value net/mac)\"; CIDR=\"$(value node_cidr)\"; GW=\"$(value node_gw)\"; DNS=\"$(value net/dns)\"\nif [ -z \"$MAC\" ] || [ -z \"$CIDR\" ]; then\n  refuse \"no captured network on the state partition (tarsana/net/mac, tarsana/node_cidr): this node was not enrolled by a takeover\"\nfi\ncase \"$MAC\" in\n  [0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]) ;;\n  *) refuse \"tarsana/net/mac is not a MAC address\" ;;\nesac\ncase \"$CIDR\" in */*/*|*/) refuse \"tarsana/node_cidr is not an address/prefix\" ;; esac\nPREFIX=\"${CIDR#*/}\"\ncase \"$CIDR:$PREFIX\" in\n  */*:[0-9]|*/*:[12][0-9]|*/*:3[0-2]) ;;\n  *) refuse \"tarsana/node_cidr is not an address/prefix\" ;;\nesac\nipv4 \"${CIDR%/*}\" || refuse \"tarsana/node_cidr is not an IPv4 address/prefix\"\n[ -z \"$GW\" ] || ipv4 \"$GW\" || refuse \"tarsana/node_gw is not an IPv4 address\"\nNS=\"\"\nif [ -n \"$DNS\" ]; then\n  case \"$DNS\" in *[!0-9.,]*) refuse \"tarsana/net/dns is not a list of IPv4 addresses\" ;; esac\n  _old=$IFS; IFS=,\n  for _d in $DNS; do\n    ipv4 \"$_d\" || { IFS=$_old; refuse \"tarsana/net/dns is not a list of IPv4 addresses\"; }\n    NS=\"$NS $_d\"\n  done\n  IFS=$_old\nfi\n\nmkdir -p \"$NETWORK_DIR\" \"$RUN\" || refuse \"cannot make $NETWORK_DIR or $RUN\"\n{\n  echo \"# Written at boot by /usr/local/sbin/tarsana-node-network from the state partition (X418).\"\n  echo \"[Match]\"\n  echo \"MACAddress=$MAC\"\n  echo \"[Network]\"\n  echo \"Address=$CIDR\"\n  if [ -n \"$GW\" ]; then\n    echo \"[Route]\"\n    echo \"Gateway=$GW\"\n    echo \"GatewayOnLink=yes\"\n  fi\n} > \"$NETWORK_DIR/$UNIT.new\" || refuse \"cannot write $NETWORK_DIR/$UNIT\"\nmv \"$NETWORK_DIR/$UNIT.new\" \"$NETWORK_DIR/$UNIT\" || refuse \"cannot write $NETWORK_DIR/$UNIT\"\nsay \"$MAC: $CIDR, gateway ${GW:-<none>} -> $NETWORK_DIR/$UNIT\"\n\nif [ -n \"$NS\" ]; then\n  # Rewritten in place, never replaced: a bind mount holds the inode it was made on.\n  : > \"$RUN/resolv.conf\" || refuse \"cannot write $RUN/resolv.conf\"\n  for _d in $NS; do echo \"nameserver $_d\" >> \"$RUN/resolv.conf\"; done\n  chmod 644 \"$RUN/resolv.conf\"\n  if [ -z \"$(findmnt -rn -o TARGET --mountpoint \"$RESOLV\" 2>/dev/null)\" ]; then\n    mount --bind \"$RUN/resolv.conf\" \"$RESOLV\" || refuse \"cannot bind $RUN/resolv.conf over $RESOLV\"\n  fi\n  say \"resolvers:$NS -> $RESOLV\"\nelse\n  say \"no captured resolvers: $RESOLV is left as the image has it\"\nfi\n# systemd-networkd normally starts after this unit and reads the file then; one already running\n# is told to read it again.\nif systemctl -q is-active systemd-networkd.service 2>/dev/null; then networkctl reload 2>/dev/null || :; fi\nexit 0\n"},
    {"path": "/etc/systemd/system/tarsana-node-network.service", "mode": "0644", "content": "[Unit]\nDescription=Tarsana: the OS network as route 3's takeover captured it on the state partition (X418)\n# Before systemd-networkd reads its configuration, after the state partition is mounted.\nDefaultDependencies=no\nRequiresMountsFor=/var/lib/tarsana-state\nAfter=local-fs.target\nBefore=systemd-networkd.service network-pre.target shutdown.target\nWants=network-pre.target\nConflicts=shutdown.target\n[Service]\nType=oneshot\nExecStart=/usr/local/sbin/tarsana-node-network\nRemainAfterExit=yes\n[Install]\nWantedBy=multi-user.target\n"},
    {"path": "/etc/systemd/system/multi-user.target.d/50-tarsana-node-network.conf", "mode": "0644", "content": "# X418: pulls the OS network into every boot -- the captured network, then systemd-networkd, which\n# brings it up. A drop-in, because the spec path writes files and enables no node unit (F-326).\n[Unit]\nWants=tarsana-node-network.service systemd-networkd.service\n"},
    {"path": "/etc/systemd/system/network-online.target.d/50-tarsana-network-online.conf", "mode": "0644", "content": "# X418: network-online.target, which the update agent's run waits for, means the captured network\n# is up (systemd-networkd-wait-online), not merely that systemd-networkd has started.\n[Unit]\nWants=systemd-networkd-wait-online.service\nAfter=systemd-networkd-wait-online.service\n"}
  ],
  "placement": {"provider": "hetzner-cloud", "server_type": "cpx12"}
}

4. Create the server

You give the server a name of your own, the request_id.

API

Call create-server:

curl -X POST "https://api.tarsana.io/v1/tenants/$TENANT/submissions/$SUBMISSION/create-server" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT" \
  -H "Content-Type: application/json" \
  --data '{"request_id": "web-1"}'

If it worked, you see the server's ID at Hetzner in created.target.id:

{
  "provider_name": "hetzner",
  "created": {
    "action_id": "ff97f81e3825703462ecab41c1c4ffa3",
    "idempotent_replay": false,
    "operation_id": "5000",
    "state": "provisioning",
    "target": {
      "id": "1000",
      "region": "fsn1"
    }
  },
  "first_boot": {
    "carrier": "user-data",
    "runs": "A sentence about the one-time setup.",
    "secret": "A sentence about the server's own enrollment token."
  }
}

Portal

Under Images ready to use, choose Create a server on your image's row. The form Create a server from your spec opens with tenant and submission filled in. Fill in request_id, for example web-1, press Review and then Confirm and send. The answer shows the server's ID at Hetzner.

MCP

Ask your agent:

Your agent calls the create-server tool:

{
  "method": "tools/call",
  "params": {
    "name": "create-server",
    "arguments": {
      "tenant": "acme",
      "submission": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1",
      "request_id": "web-1"
    }
  }
}

The server's ID at Hetzner is created.target.id. You do not have to keep it: step 5 lists it again.

A 200 answer means the server exists at Hetzner. It then boots, runs its one-time setup and connects to Tarsana. Password login is switched off and no SSH key is installed.

If the request fails part of the way, send the same request again with the same request_id: you get the same server back, never a second one. The errors you may see:

CodeWhat to do
create_unavailableCheck your stored token with provider-credential.
not_creatableThe stored spec has no placement. See step 3.
not_provisionableWait until the build has succeeded.
create_refusedHetzner refused, for example the server type is not sold in that region. Fix the cause and try again.

5. See your servers

managed-servers lists the servers Tarsana created in your Hetzner project: for each one its ID at Hetzner, its name and state, when it was created, the image it was created from and how its latest update went. Its action_id is the server's name in your account, which request-update takes.

API

curl "https://api.tarsana.io/v1/tenants/$TENANT/providers/hetzner/managed-servers" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT"
{
  "servers": [
    {
      "id": "1000",
      "name": "tarsana-ff97f81e3825703462ecab41c1c4ffa3",
      "server_type": "cpx12",
      "location": "fsn1",
      "created": "2026-10-05T02:15:41+00:00",
      "addresses": [
        "198.51.100.10",
        "2001:db8::/64"
      ],
      "state": "running",
      "action_id": "ff97f81e3825703462ecab41c1c4ffa3",
      "request_id": "web-1",
      "image": "sha256:cdff062988d4722b2ff052c97ebefb8b571858c493ce47b159df73b1c88809b1",
      "update": {
        "state": "not_requested"
      }
    }
  ]
}

Portal

Your dashboard lists them under Your servers, one row per server, with its ID, State, Image and Update. Each row has Request update and Decommission; you use the second in step 7.

MCP

Ask your agent:

Your agent calls the managed-servers tool:

{
  "method": "tools/call",
  "params": {
    "name": "managed-servers",
    "arguments": {
      "tenant": "acme",
      "provider_name": "hetzner"
    }
  }
}

Your new server is on the list as soon as Hetzner has given it an ID.

6. See the other servers in your account

servers lists the servers in your Hetzner project that Tarsana did not create, and counts the ones it did.

API

curl "https://api.tarsana.io/v1/tenants/$TENANT/providers/hetzner/servers" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT"
{
  "accounted_for": 1,
  "servers": [
    {
      "id": "1001",
      "name": "my-own-box",
      "server_type": "cx22",
      "location": "nbg1",
      "state": "running",
      "created": "2026-10-05T02:15:41+00:00",
      "addresses": [
        "198.51.100.11"
      ],
      "labels": {},
      "reason_code": "no_label",
      "reason": "A sentence that says why this server is listed."
    }
  ]
}

Portal

Your dashboard shows them under Servers Tarsana did not create, with the reason each one is listed under Why it is listed.

MCP

Ask your agent:

Your agent calls the servers tool:

{
  "method": "tools/call",
  "params": {
    "name": "servers",
    "arguments": {
      "tenant": "acme",
      "provider_name": "hetzner"
    }
  }
}

Your new server is counted in accounted_for. A server you made yourself is listed, with the reason Tarsana does not count it as its own. Tarsana never removes a listed server unless you ask.

7. Remove the server when you are done

decommission-server revokes the server's own credentials, deletes it at Hetzner and waits until it is gone.

API

export SERVER_ID=paste-the-servers-id-value-from-managed-servers
curl -X POST "https://api.tarsana.io/v1/tenants/$TENANT/providers/hetzner/servers/$SERVER_ID/decommission" \
  -H "X-Tarsana-Access-Token: $ACCESS_TOKEN" \
  -H "X-Tarsana-Tenant: $TENANT"
{
  "decommissioned": {
    "state": "destroyed",
    "observed": "not-found",
    "action_id": "ff97f81e3825703462ecab41c1c4ffa3",
    "idempotent_replay": false,
    "requested_at": "2026-10-05T02:15:41.166635+00:00",
    "completed_at": "2026-10-05T02:15:41.169045+00:00",
    "target": {
      "id": "1000",
      "region": "fsn1"
    }
  }
}

Portal

Under Your servers, choose Decommission on the server's row. The form Decommission a server that Tarsana created opens with tenant, provider_name and server_id filled in for that server. Press Review, check the server ID, and then press Confirm and send. Back on the dashboard, the server is no longer listed.

MCP

Ask your agent, with the server ID:

Check what it is about to remove before you let it go ahead.

Your agent calls the decommission-server tool:

{
  "method": "tools/call",
  "params": {
    "name": "decommission-server",
    "arguments": {
      "tenant": "acme",
      "provider_name": "hetzner",
      "server_id": "1001"
    }
  }
}

You cannot undo this. If it stops part of the way, send the same request again to continue.

Next steps

View this page as Markdown