Seaweed Block
Block storage for AI agent workspaces at local-disk speed, with snapshots, restore and moves backed by your own
SeaweedFS. Each sandbox or microVM gets a plain virtio block disk. Writes
and fsync complete on the host's local disk; cuts copy the changed data to SeaweedFS in the background. Losing the
host loses what was written since the last successful cut: normally about a day with the default schedule (one
snapshot a day), not a guaranteed bound; --chunk-capture-interval (5 minutes or more) cuts more often. The same core serves Kubernetes block volumes (alpha).
Install
The binaries are blockmaster, blockvolume and the sw-block CLI. The commands on this page are for v1.0.0.
Option 1: copy them from the v1.0.0 image,
ghcr.io/seaweedfs/seaweed-block:v1.0.0 (index digest
sha256:648980beb519a086349d44367e9d19ba6ae94b8939456ae3eb7b7bb5e4b3b28b):
docker create --name swb-extract ghcr.io/seaweedfs/seaweed-block:v1.0.0
for b in blockmaster blockvolume sw-block; do docker cp swb-extract:/usr/local/bin/$b .; done
docker rm swb-extract && ./blockvolume --version
Option 2: build from the tag v1.0.0 (the Go version in go.mod):
git clone --branch v1.0.0 https://github.com/seaweedfs/seaweed-block && cd seaweed-block
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
Option 3: Helm, see the Kubernetes quick start. Services: standalone deployment. Operator guide (supported setup, sizing, recovery point, host loss, limits): operator guide.
Try it
The first volume check
starts blockmaster and one blockvolume, attaches a 256 MiB volume over
NVMe/TCP on loopback, shows the device and its status, and stops. It does
not format or write the attached device; it only creates local backing files
and logs. It needs Linux, bash, nvme-cli, sudo and the binaries
above. To format and write, use the write test (scratch host only).
sw-block mini
A trial on a scratch host, not for data you keep. One command starts a single-host
trial on loopback, with SeaweedFS's weed mini as the chunk store (run against SeaweedFS 4.53). Build all three
binaries from the same checkout and run the one you built, so that mini finds its matching blockmaster and
blockvolume next to it:
git clone https://github.com/seaweedfs/seaweed-block && cd seaweed-block
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
./sw-block mini --dir ./swb-mini --weed /path/to/weed
It starts weed mini, blockmaster and one blockvolume (volume v1, 256 MiB, walstore-chunk with its chunk
control endpoint). Snapshots of v1 work at once. A restore into a new volume is not possible inside a mini trial
yet: mini's blockmaster is its own child and mini stops everything when a child exits, and that blockmaster
refuses a volume that is not in its one-volume cluster spec while its product loop is off. To restore today, use the
standalone setup
(restoring a snapshot).
It prints every command it runs and never runs sudo: it prints the nvme connect command that attaches v1, and
the status, check and snapshot commands. Before you stop it with Ctrl-C, unmount v1 and run the
sudo nvme disconnect it printed. If no weed is found on PATH and --weed is not given, it starts the local
engine only, with no snapshots and a banner saying so; a --weed path that does not exist is refused. More in
standalone deployment.
Why Seaweed Block
- Close to local-disk speed for agent work. In a pre-release run on the
walstoreengine (the local engine the released chunk path builds on),npm ci,git cloneand untar ran within 0-4% of a local disk for the operation itself. With the final file-system flush included on both sides, they were 11-23% slower than the local disk, and untar of 5,000 small files took about 2.2 times as long. On the released path,fsynccosts about 1.3 times local (measured results, how each was measured). fsyncis durable on the host that serves the volume. Every guestfsyncreaches the host's disk; no write cache is turned off to get the speed (a gate counts flushes against backend syncs, with an unsafe-cache control). In fault injection on the release candidate (process kills and a store pause on one host; not a power-loss test), 0 acknowledged writes were lost across 253 judged; the same runs failed other operation checks, listed with the record. If the host itself is lost, the volume comes back from its last cut (records).- Snapshots in your object store. A cut uploads only the changed 4 MiB chunks. A snapshot names a root of about 2 KB and shares its chunks; a restore makes a new volume that reads them on first use (agent workspace design).
- Safe moves between hosts. One blockmaster issues epochs and leases, and a holder admits I/O only while its own
lease is current; run exactly one blockmaster per cluster. Separately, every HEAD update is conditional on
{gen, epoch}, so the store refuses a stale holder's publish even before that holder notices it was replaced (volume lifecycle, TLA+ specifications). - Self-hosted. Go, Apache-2.0, on your own hosts and your own SeaweedFS.
- Against an early FUSE prototype on the same host (host-side, built on the SeaweedFS filer; not a released
product), in the same pre-release run, untar,
npm ciandgit clonewere 4 to 36 times faster with the final flush included;fsync-bound work took the same time (record).
Measured results
Lab runs, median of 3; not SLOs. Workloads: Firecracker microVMs (4 vCPU, 4 GiB) on one bare-metal host over
NVMe/TCP loopback, against a local file-backed disk. The first four rows come from a pre-release build on the
walstore engine and time the operation itself. With the final syncfs flush included on both sides (recorded
separately), the first three are 11-23% slower than the local disk (see the measurements page). The two fsync rows come from a later run of the released path
(walstore-chunk) on the same host, after the group-commit fix
(#173). The chart is drawn from
measured-results.csv by docs/assets/readme-chart.py.
| Measurement | Seaweed Block | Local disk |
|---|---|---|
npm ci (617 packages, offline) / git clone (Go 1.23, local) |
2.14 s / 7.10 s | 2.14 s / 6.99 s |
Untar 100,000 files / cold find + stat over them |
1.10 s / 0.32 s | 1.06 s / 0.33 s |
2,000 × create + write + fsync |
9.27 s | 6.11 s |
Guest fsync median, fio 4 KiB random write, one at a time |
3.59 ms | 2.74 ms |
| Snapshot of a 10 GiB volume (2,560 chunks) | 0.18 ms | |
| Two-host lifecycle (pre-release): create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks |
The snapshot row is a host-side proxy without network latency, guest fsync or the block frontend. The two-host
lifecycle row is a pre-release run that included fork (removed from this release) and the earlier GC. The remaining
cost is fsync: a median of 3.59 ms against 2.74 ms local over NVMe/TCP loopback. The ublk frontend measured
3.23 ms in the same run; ublk is not among v1.0.0's supported frontends (NVMe/TCP and iSCSI).
Workspace measurements has every number, the FUSE comparison and how each was
measured.
Status and limits
- Recovery point: a lost host loses what was written since the volume's last successful snapshot or cut:
normally about a day with the default schedule (one scheduled snapshot a day, which is attempted, not
guaranteed).
--chunk-capture-interval(5 minutes or more) adds periodic cuts and shortens it. - v1.0.0 supports the single-replica volume (
--durable-impl walstore-chunk), backed up to SeaweedFS with snapshots, restore, moves and volume delete. New volumes are at most 256 GiB. See the release note and its known limits. - Replicated volumes are a preview (replicated volumes preview).
- Kubernetes is an alpha, for supported lab clusters (Kubernetes status).
Direction
Seaweed Block is block storage for AI agent workspaces: one local-speed disk per sandbox or microVM, with its history (snapshots, restores, moves) in your own SeaweedFS. The same core serves Kubernetes block volumes (alpha).
- Works today (v1.0.1): single-replica volumes up to 256 GiB over NVMe/TCP or iSCSI; scheduled and manual
snapshots; restore into a new volume; a planned hand-over to another machine (run across two machines on the
release candidate); a forced move after a host is lost, from the volume's last cut (tested with two server
identities on one machine); volume delete. Each is a documented sequence of
sw-block opscommands and systemd units. v1.0.1 addssw-block mini, a single-host trial; whole-job volume commands (sw-block volume start,stop,backup,restore);sw-block shellfor inspection, withcluster.checkand a troubleshooting page; a log bundle without secrets; and a workingops chunk verify(see the v1.0.1 note). - After that, planned: volumes up to 1 TiB (v1.1); replicated volumes beyond the preview; export of a snapshot to another object store, and
import from it;
volume forkandvolume movecommands.
Agent workspace disks: chunk lifecycle
The workspace path runs blockvolume with --durable-impl=walstore-chunk,
--chunk-filer <filer> and --chunk-control-endpoint, against a SeaweedFS
cluster. The sw-block ops chunk commands drive the lifecycle:
sw-block ops chunk cut --volume v1 --status-addr <status> # publish changed chunks, advance HEAD
sw-block ops chunk snapshot --volume v1 --status-addr <status> --name s1 # name a snapshot
sw-block ops chunk snapshots --master <blockmaster> --volume v1 --chunk-filer <filer> # list snapshots
sw-block ops chunk restore --master <blockmaster> --chunk-filer <filer> --source v1 --snapshot s1 --target v3 # new volume from a snapshot
sw-block ops chunk detach --volume v1 --status-addr <status> # final cut (seal); moving needs revoke + move, see docs/volume-lifecycle.md
sw-block ops chunk volume-delete --volume v3 --chunk-filer <filer> --master <blockmaster> --request-id del-v3
volume-delete is refused until the volume's holder has been revoked and its ACK
is recorded, and while the volume has snapshots: see
Delete a volume.
Frozen detach and the pre-copy detach are not supported in this release: a
detach with --frozen (frozen:true on POST /chunk/detach) is refused with
409 frozen_detach_unsupported, and blockvolume refuses to start with
--chunk-detach-precopy.
restore creates the target from the snapshot; its blockvolume serves at
once and reads every chunk it has not made local from the source's snapshot
(there is no background copy). The source snapshot cannot be deleted while the
target exists. Fork is not supported in this release; the command is removed.
See Restoring a snapshot.
In v1.0.0 the chunk path (walstore-chunk) is the supported single-replica
configuration (release note, operator guide);
it is not the --durable-impl default.
Quick start: Kubernetes (alpha)
For supported lab clusters, not production. From the repository root, with
kubectl and helm configured:
go build -o sw-block ./cmd/sw-block && export PATH="$PWD:$PATH"
sw-block ops generate-helm-values --out values.day1.yaml \
--image ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b
helm install sw-block charts/seaweed-block --namespace kube-system \
--create-namespace -f values.day1.yaml --wait --timeout 10m
SW_BLOCK_INSTALL_MODE=helm SW_BLOCK_HELM_RELEASE=sw-block \
SW_BLOCK_HELM_NAMESPACE=kube-system SW_BLOCK_HELM_VALUES_FILE=values.day1.yaml \
bash scripts/run-basic-app-example.sh "$PWD"
The last command writes a PVC from one pod and reads it from a replacement
pod; expect first_volume_status=ok in
/tmp/sw-block-basic-app-*/first-volume-summary.txt. sha-dc2972d0059b is
the validated tag for the v0.4 read-only status path; later paths need
matching release images, and
:alpha is for smoke tests only. Each step's output is in the Kubernetes
quickstart. To clean up:
helm uninstall sw-block --namespace kube-system
bash scripts/uninstall-k8s-alpha.sh "$PWD" && bash scripts/verify-helm-cleanup.sh
Detailed status
| Area | Status |
|---|---|
Agent workspace disks (walstore-chunk), single replica |
Supported in v1.0.0; see its known limits |
Replicated volumes (replication_factor above 1) |
Preview in v1.0.0 (replicated volumes preview) |
| Kubernetes: Helm install, PVC provisioning, writer/reader check, read-only report and dashboard, CRD status and Events, support-bundle replay | Available (alpha) |
| Kubernetes: RF=3 multi-volume, CSI reattach recovery, iSCSI ALUA/dm-multipath mounted failover, restart persistence with hostPath | Gated (supported lab) |
Kubernetes: SwBlockVolume finalizer lifecycle owner, returned-replica ACK eligibility executor |
Beta candidate |
| Kubernetes: NVMe/TCP CSI multipath, returned-replica failback runtime, WAL multi-block record opt-in | Source-gated |
| Kubernetes: backup, snapshot and restore; returned-replica rebuild traffic | Planned |
Full table and conditions: Kubernetes status; run evidence: release notes.
Upgrade note: blockmaster listens off loopback only with mutual TLS
(--tls-cert, --tls-key, --tls-client-ca, --role-file); the runtime HTTP
listener always stays on loopback, and --insecure-external-bind is refused.
The Helm chart and the shipped manifests run with mutual TLS; create their
Secrets first (quickstart).
Not claimed yet
- Production readiness, SLOs, or a published performance, RTO or RPO claim.
fsyncparity with local disk. Today it is about 1.3× local over NVMe/TCP (see Measured results).- ublk at high density. Unprivileged per-volume servers need a privileged control broker, which is not done.
- Crash-restart recovery of a ublk server. A crashed server fails closed.
- Multi-replica workspaces combined with chunk snapshots.
- The
smartwalengine, which is experimental: no rollback for a torn in-place overwrite, no per-block CRC once its ring record recycles, open handling of a corrupted committed record, and no chunk snapshots. - Kubernetes: backup and restore, a production operator, automatic failback or cleanup, upgrade execution, broad compatibility, and more: see what you should not expect yet.
Correctness and verification
- CI runs
go build,go vetandgo test -shorton every pull request and push tomain(workflow); that set leaves out the four long, disk-heavy packages (a pull request runs those of them it changes); they run in full, together with the legacy-fixture configuration, on a separate test VM for every merge train (commit statusfull-suite (pool VM)on the train head). Crash, mutation, real-SeaweedFS and binary tests are described in the core design, Part 2, with the known issues. - Formal models: TLA+ specifications of the protocols where a bug would lose data. Counterexamples became fixes and regression tests (#152, #156, #158, #159).
- Fail closed: recovery that cannot establish a consistent image reports
a typed reason (
wal_corrupt,io_error) instead of serving; some suspected damage (wal_hole_suspected) is a status warning only.
Documentation
- Design: core, agent workspace, Kubernetes block, invariants and state machines, TLA+ specifications, workspace measurements
- Operations: standalone deployment, volume lifecycle, Kubernetes quickstart, user capabilities
- Claims: Kubernetes status, release notes, NVMe/TCP supported-lab claim, known issues and work in progress
- Engineering references, not release-claim sources: architecture, developer architecture, runtime state machines
Development
go build ./... && go vet ./... && go test -short ./... # what CI runs
go test ./cmd/sw-block ./core/ops ./core/csi ./core/launcher ./core/host/master -count=1 # release-scoped
The full go test ./... sweep may include in-progress packages outside the
release gate. scripts/activate-k8s-alpha.sh remains for local images.
Community
Questions and bug reports: GitHub Issues. Seaweed Block builds on SeaweedFS.
License
Apache-2.0