Repository navigation
Description
Implements lifecycle: ephemeral from #193 — the path lagotto#43 actually needs.
Why async + spored, not the current flow
FSx Lustre takes ~10 min to reach AVAILABLE. lagotto reacts to scarce capacity from a Lambda, so it cannot block on creation (the capacity is gone by the time the FS is ready, and the Lambda would time out). And today's mount happens in first-boot user-data (pkg/userdata/storage.go), which can't wait for a still-CREATING filesystem.
Design (decision from the lagotto#43 discussion)
Grab capacity instantly, provision FSx in parallel, let the instance do the waiting:
- Launch path, on ephemeral
--fsx-create: fireRunInstancesandCreateFileSystem(both return immediately), tag the instancespawn:fsx-pending=<fs-id>(+ mount-point, s3 paths). Lambda/CLI returns in seconds. No blocking wait. - spored gains a "wait-for-pending-FSx → mount" step: on boot, if
spawn:fsx-pendingis set, pollDescribeFileSystemsuntil AVAILABLE, then mount (the samemount -t lustre …@tcp:/<mountname>the user-data block does today), and rewrite the tag tospawn:fsx-idso the refcount join (ttl-reaper must reclaim orphaned FSx Lustre filesystems (cost backstop; prerequisite for any FSx auto-create) #192) sees it as an active user. - The instance owns the FSx lifetime: refcount → 0 on terminate → reaped (ttl-reaper must reclaim orphaned FSx Lustre filesystems (cost backstop; prerequisite for any FSx auto-create) #192). No TTL needed.
Cost note
The only added cost is the slice of FSx-provisioning that extends past when the instance would otherwise be compute-ready — it overlaps boot/spored-install/data-staging, so marginal waste is typically << $1 per job, and zero if capacity never appears (no instance, no FSx). Far cheaper than pre-provisioning FSx for an unbounded scarce-capacity wait.
Scope
- Launch path: async
CreateFileSystem+spawn:fsx-pendingtagging; ensure Lustre SG ports (reuseEnsureLustrePorts). - spored: pending-FSx poller + mount; flip tag to
spawn:fsx-idon success; surface a notification on mount failure (ties to pre-stop: surface a loud signal when the hook transfers nothing / exits non-zero #186 pattern). - Export DRA must be continuous so results stream to S3 (not a single terminate-time flush — the --pre-stop does not reliably flush before TTL-triggered terminate → data loss on ephemeral storage #184 lesson).
- Refcount/reaper safety comes from ttl-reaper must reclaim orphaned FSx Lustre filesystems (cost backstop; prerequisite for any FSx auto-create) #192 (gate).
Activity
feat(ttl-reaper): reclaim orphaned FSx Lustre filesystems (refcount-a…
scttfrdmn commentedon Jun 16, 2026
AZ behavior — ephemeral FSx follows the instance (no pinning)
FSx Lustre lives in a single subnet → single AZ, and a Lustre mount is same-AZ only. For the ephemeral path this is a non-issue and a strength: the FSx is created in whatever AZ the instance landed in (decided at launch, after lagotto's #34 AZ-fallback has already caught capacity wherever it appeared). So:
CreateFileSystemmust target the chosen instance's subnet/AZ (use the same subnet the instance launched into).spawn fsx create --name --ttl(standalone, shared, reused across launches) #195), which pins the AZ.Folding into scope: the async
CreateFileSystemcall uses the instance's resolved subnet (so FSx AZ = instance AZ, guaranteed mountable).feat(fsx): explicit fail-closed lifecycle contract for --fsx-create (#…
feat(spored): mount async-created FSx at runtime (#194 part 1) (#198)
scttfrdmn commentedon Jun 16, 2026
Part 1 shipped (#198, merged)
spored now mounts a pending FSx: reads
spawn:fsx-pending, polls to AVAILABLE off the lifecycle critical path, mounts (Lustre/Linux), flips tospawn:fsx-idfor the reaper refcount. Best-effort, never gates lifecycle.Part 2 design (launch-side async create) — decided, not yet built
Mapped against the code; recording so it's a clean, self-contained next PR.
The non-obvious bit — the S3 export DRA moves to spored. Today
CreateFSxLustreFilesystemdoes CreateFileSystem → block until AVAILABLE → CreateDataRepositoryAssociation, all in one synchronous call. For the async/ephemeral path the launch side can't block, so:pkg/aws:CreateFileSystemonly, return thefs-idimmediately (stillCREATING). No wait, no DRA.config.FSxPending=<id>+ carry the import/export paths via tags (spawn:fsx-import-path/spawn:fsx-export-pathalready exist) so spored knows what DRA to make. buildTags writesspawn:fsx-pending. Launch returns in seconds.fsx:CreateDataRepositoryAssociationperms.spawn fsx create --name --ttl(standalone, shared, reused across launches) #195 will give itspawn fsx create). Only ephemeral goes async.IAM (deploy-side): spored instance role gains
fsx:CreateDataRepositoryAssociation(+ thefsx:DescribeFileSystemspart 1 already needs).Testability: the create-and-DRA-against-real-FSx path isn't substrate-coverable (substrate#331); wants a live FSx validation before the feature is announced — same caveat as part 1.
This is the largest remaining piece in the chain; lagotto#43 (just forwarding the
fsx:block) unblocks once it lands.chore(release): v0.56.0 (#200)
feat(launcher): ephemeral async FSx-create in Provision (#202) (#203)
refactor: create ephemeral FSx after RunInstances succeeds (#213) (#215)
fix: spored reliably mounts async ephemeral FSx (#221) (#253)