Skip to content

FSx ephemeral path: async-create + spored wait-and-mount (instance-owned, lagotto-safe) #194

Closed

Description

@scttfrdmn

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:

  1. Launch path, on ephemeral --fsx-create: fire RunInstances and CreateFileSystem (both return immediately), tag the instance spawn:fsx-pending=<fs-id> (+ mount-point, s3 paths). Lambda/CLI returns in seconds. No blocking wait.
  2. spored gains a "wait-for-pending-FSx → mount" step: on boot, if spawn:fsx-pending is set, poll DescribeFileSystems until AVAILABLE, then mount (the same mount -t lustre …@tcp:/<mountname> the user-data block does today), and rewrite the tag to spawn:fsx-id so 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.
  3. 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

Blocked by #192 and the #193 contract. Drives lagotto#43.

Activity

  1. added
    enhancement
    area:launch
    area:spored
    area:storage
    on Jun 16, 2026
  2. scttfrdmn commented on Jun 16, 2026

    @scttfrdmn
    ContributorAuthor

    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:

    Folding into scope: the async CreateFileSystem call uses the instance's resolved subnet (so FSx AZ = instance AZ, guaranteed mountable).

  3. scttfrdmn commented on Jun 16, 2026

    @scttfrdmn
    ContributorAuthor

    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 to spawn:fsx-id for 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 CreateFSxLustreFilesystem does CreateFileSystem → block until AVAILABLE → CreateDataRepositoryAssociation, all in one synchronous call. For the async/ephemeral path the launch side can't block, so:

    1. New non-blocking create in pkg/aws: CreateFileSystem only, return the fs-id immediately (still CREATING). No wait, no DRA.
    2. Launch branch (ephemeral): fire that async create in the instance's subnet (AZ co-location — the FSx must be in the instance's AZ; resolve subnet first), then set config.FSxPending=<id> + carry the import/export paths via tags (spawn:fsx-import-path/spawn:fsx-export-path already exist) so spored knows what DRA to make. buildTags writes spawn:fsx-pending. Launch returns in seconds.
    3. spored (extends part 1): after AVAILABLE, create the DRA (decision: spored owns it — keeps launch non-blocking, consistent with the async model) using the carried import/export paths, then mount. spored's role needs fsx:CreateDataRepositoryAssociation perms.
    4. durable stays the blocking create (it's a deliberate up-front action; FSx durable path: spawn fsx create --name --ttl (standalone, shared, reused across launches) #195 will give it spawn fsx create). Only ephemeral goes async.

    IAM (deploy-side): spored instance role gains fsx:CreateDataRepositoryAssociation (+ the fsx:DescribeFileSystems part 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:launcharea:sporedarea:storageenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions