Skip to content

Devices, Workers and System Disks ​

Kurrent splits the compute side into three independent entities. Each has its own identifier and authority, and a bootable system is formed by binding them together. Machines, identities and disks can therefore be replaced separately.

EntityIdentifierAuthorityDetermines
DeviceMACDevice ledger state/devices.ymlWhich physical machine
Workerworker_id (hostname)Worker ledger state/workers.ymlUnder which identity
System diskNQNDisk file on the storage node + Worker ledgerWhich system to boot

Device ​

A device represents a physical machine. On its first network boot, firmware reports an 11-field fingerprint (MAC, UUID, SMBIOS, CPU, memory, NIC and others) and the device public key; the control plane records it under the MAC.

A device record contains:

FieldMeaning
macUnique device identifier; the authoritative anchor of the binding
uuid / fingerprintReported hardware information for identification and audit
statepooled / bound / revoked
bound_worker_idBound Worker; empty when unbound
Public-key hashDigest of the device identity key, used for admission when signature enforcement is on
sourceipxe (automatic report) or manual (manual registration/import)

Lifecycle:

text
pooled ──bind──► bound ──revoke──► revoked
  ▲                │
  └────unbind──────┘
  • Registration is not authorization. Entering the pool only means "this machine has been seen"; it grants no boot rights. Only after binding to a Worker does the device become that Worker's booting node.
  • Automatic admission happens only while the registration window is open and the report carries a valid public key; once closed, reports only update fingerprints and add no entries. Manual registration and purging revoked entries are not limited by the window.
  • revoked devices no longer accept reports; the dnsmasq binding file receives MAC,ignore, so a revoked device gets no lease.

Worker ​

A Worker is a compute identity. worker_id doubles as the hostname and is the index for ledgers and credentials. It is not a machine identity and survives hardware replacement.

A Worker record contains:

FieldMeaning
worker_idCompute identity; ledger primary key
Bound deviceProjected from the device ledger; not stored separately
disks[]Mounted system disks
default_diskDefault boot disk (os_tag)
bootOptional menu entry and timeout overrides
stateregistered (identity only) or ready (has a system disk)

readiness is a derived read-only projection:

ValueCondition
readyHas a bound device and a system disk
partialHas only a bound device, or only a system disk
idleHas neither

System Disk ​

A system disk is a disk file on a storage node, identified authoritatively by its NQN on the data plane:

text
NQN    = <nqnBase>:<worker_id>.<os>.<os_tag>
IQN    = derived from the NQN (consumed by the iSCSI backend and installers)
os_tag = 12 random hex digits (disk-level identifier)
file   = <worker_id>.<os>.<os_tag>.img
  • os and os_version are display and grouping metadata; os has no allowlist. A Worker may hold at most one disk per (os, os_version), while different versions may coexist.
  • A disk can be cloned from a master image or created as an empty disk. Master images are never booted; they are only clone sources.
  • os_tag is generated by the control plane at creation. Once the NQN is projected into boot variables, it is the disk's unique identifier.

Default Disk ​

The default disk determines which system boots after the menu timeout:

  • The first system disk becomes the default automatically; later disks do not rewrite the default.
  • When the default disk is deleted, a remaining disk is promoted automatically; with no disks left, default_disk is cleared.
  • Without a default, /boot-vars returns menu-default=reboot, so the machine never silently boots the wrong system.

Master Images ​

A master image is a disk file under the storage node's spec.agent.diskDir whose filename contains _tpl_ (case-insensitive). A background scanner caches the master list and GPT layout:

  • Both master images and system disks must use 4K-native GPT. A 512-byte-sector layout is rejected by both the Agent and nvmet-host, because firmware cannot parse the exported partition table.
  • The filesystem must support reflink (btrfs / xfs) for near-instant cloning; ext4 degrades to a full copy.
  • Master tags (os / os_version / remark) are stored in the Agent ledger and used only for display and disk selection.

Binding ​

The binding is one-to-one: a device belongs to exactly one Worker, and a Worker has at most one bound device.

  • Authority is on the device side. bound_worker_id in devices.yml is the single fact; the bound device in a Worker response is only a projection. The dnsmasq hostname mapping is also a derived projection and does not participate in boot identity resolution.
  • Binding is authentication. /boot-vars verifies that the requesting MAC belongs to the matched Worker's bound device, preventing another device from claiming the identity.
  • Rebinding is atomic. With force=true, the new binding is written before the old one is cleared; a ledger snapshot is restored on failure.
  • Unbinding only affects the device. The device returns to the pool while the Worker keeps its disks, default disk and credentials.

Rebinding as Cold Migration ​

Rebinding device A to device B is a cold migration:

  1. Confirm B is registered with a device identity key, and the target Worker's credentials are effective on the storage node.
  2. Power off or isolate A; live migration and data-plane fencing are not provided.
  3. Rebind B on the Devices page; the system disk and Worker identity stay unchanged.
  4. B boots, passes challenge-response and receives the connection information for the same disk.

The same path works in reverse; there is no automated orchestration yet.

Placement ​

When a system disk is created, the control plane decides the location unless disk_agent or a pin is explicit:

  1. The candidate must have the disk role, be enabled (not drained), have a reachable base_url, and report a ready data-plane port.
  2. When cloning, the master image must exist locally on that node.
  3. Among candidates, the node with the fewest existing system disks is chosen (load spreading).
  4. An explicit pin overrides automatic placement, but the pinned node must still pass availability checks.

Batch creation uses the same placement implementation for dry_run and execution; the preview is the plan that will run.

Deletion Semantics ​

OperationResult
Delete a system disk (delete_file=false)Removes the export target, keeps the disk file, removes the ledger entry
Delete a system disk (delete_file=true)Also deletes the backing file; irreversible
Delete the default diskPromotes a remaining disk; clears the default when none remain
Delete a WorkerUnbinds the device, removes the Worker's credential entry and push record; disk files handled by option
Unbind a deviceDevice returns to the pool; Worker and disks unchanged
Revoke a deviceEnters revoked and no longer accepts reports; the purge entry removes only revoked records

Recreating a Worker with the same name does not inherit old credentials: the credential entry is removed with the Worker. A retained disk file can be mounted again, but its NQN and ledger record must be re-established.