Skip to content

How Atlas works

Atlas is the virtual machine control system for Frappe Cloud. It has 4 main components with clear ownership boundaries.

Read this page first. It explains how a user request becomes a running Firecracker virtual machine.

The system at a glance

Atlas decides what must exist. Metal makes one host match that decision. The proxy and WG Mesh carry traffic to the VM.

PathFlowPurpose
VM controlUser → Atlas → Metal → FirecrackerCreate, update, start, stop, and delete a VM.
Public trafficInternet → HTTP proxy → VMRoute a site or custom domain to its VM.
Private trafficVM → WG Mesh → VMCarry private packets between VMs on different hosts.
StorageObject storage → Metal cache → ZFS diskCreate VM disks and transfer images or snapshots.

Why Atlas and Metal are separate

Atlas owns user intent and provider resources. Metal owns host state and VM resources.

This split lets each component recover from its own durable state. A Metal restart does not stop a VM. An Atlas outage does not erase host intent.

OwnerDurable responsibility
AtlasProvider resources, Metal Server records, placement, image records, public IPv4 intent
MetalDesired VM state, observed VM state, reservations, and cleanup progress
systemdOne Firecracker process for each running VM
ZFSBase images, VM disks, snapshots, and migration staging data
HTTP proxyRegional site routes, custom domains, and route generations
WG MeshPrivate VM location and packet forwarding between hosts

Desired and observed state

Desired state describes what Atlas wants. Observed state describes what Metal currently sees on the host.

Atlas reads current Metal state when it needs it. Atlas does not copy changing runtime state into durable DocType fields.

How a VM is created

Atlas commits a draft before it calls Metal. The draft reserves capacity and gives the request a stable VM ID.

Architecture diagram
Loading diagram...

If the create response is lost, Atlas keeps the draft. It reads Metal before it retries or removes the draft.

Read VM control plane for placement, reservations, and retry rules.

How a Metal Server is provisioned

Atlas creates provider resources in a background job. Each completed phase stores its progress before the next external action starts.

  1. Atlas validates the provider settings and server catalog.
  2. Atlas creates a pending Metal Server record.
  3. Atlas creates or reuses the provider host.
  4. Atlas configures public addresses and the private network.
  5. Atlas configures WireGuard and issues the Metal certificate.
  6. Atlas installs Metal and marks the server as running.

A retry uses the stable Metal Server identity. Atlas removes a provider host only when the current request created that host.

Read Metal Server lifecycle for phase ownership and failure recovery.

How placement uses capacity

Metal reports a capacity sample to Atlas. Atlas accepts a sample that is less than 2 minutes old.

CheckWhy Atlas needs itResult on failure
The image architecture matches the hostFirecracker must use a compatible kernel and root disk.Skip the host.
The capacity sample is less than 2 minutes oldOld data can cause unsafe placement.Skip the host.
Memory and storage remain after recent reservationsConcurrent requests must not reserve the same capacity.Skip the host.
Capacity still fits after Atlas locks the server rowPlacement must use one final serialized check.Select another host.

CPU entitlement can exceed physical CPU capacity. Memory and storage must be available when Atlas selects the host.

How images and snapshots move

Atlas owns image records and object storage. Metal owns local images, VM disks, and snapshot staging data.

OperationSourceDestination
Prepare a VM diskObject storageMetal image cache, then a ZFS clone
Create an imageVM diskMetal staging, then object storage
Register an imageUploaded objectAtlas Machine Image record

Warm Firecracker state stays on one host. Atlas uploads the disk and kernel, but it does not upload guest memory.

Read Image lifecycle for cache policy, image transfer, and deletion.

How a VM moves to another host

Migration copies the disk while the source VM runs. Metal then stops the source, copies the final delta, and starts the destination.

Architecture diagram
Loading diagram...

Read VM migration for checkpoints, rollback, and failure scenarios.

Where failures stop

Each component keeps failures inside its ownership boundary.

FailureWhat remains safeWhere to investigate
Provider request failsMetal host state does not changeAtlas Error Log and Metal Server setup phase
Atlas cannot reach MetalAtlas keeps the draft or intentAtlas operations and Metal health
VM runtime failsMetal keeps desired state and error dataMetal observed state and systemd
Cleanup step failsMetal keeps cleanup progressMetal VM status record
Proxy node failsVM lifecycle state does not changeProxy readiness, leader, and DNS
WG Mesh failsVM and Metal records remain validMesh maps, discovery, and WireGuard

Start with the operations guide when you do not know which component owns a failure.

Go deeper

AGPL-3.0