Skip to content

[FSx] --fsx-create ignores --az: filesystem always lands in subnets[0], not the pinned AZ #208

Closed

Description

@scttfrdmn

Symptom (field report)

spawn launch --fsx-create ... --az us-east-1a (then 1b, then 1c) failed every time with:

BadRequest: The requested Lustre configuration: PERSISTENT_2 is not available in this availability zone.

The error text was byte-identical across all three AZs — which looked like a per-AZ availability problem with PERSISTENT_2.

It is NOT an AWS per-AZ availability problem

I probed CreateFileSystem for PERSISTENT_2 directly (raw AWS CLI, explicit subnet per AZ, immediately deleted, leak-checked) across all 6 us-east-1 AZs in the same account, twice:

AZ AZ ID Run 1 Run 2
us-east-1a use1-az1 ✅ ✅
us-east-1b use1-az2 ✅ ✅
us-east-1c use1-az4 ✅ ✅
us-east-1d use1-az6 ✅ ✅
us-east-1e use1-az3 ❌ ❌
us-east-1f use1-az5 ✅ ✅

5 of 6 AZs — including the exact 1a/1b/1c the field report "failed" on — accept PERSISTENT_2 right now. (Tested LZ4 compression and the reported 250/125 throughputs too; all succeed.) So AWS happily creates PERSISTENT_2 in those AZs.

Root cause — spawn ignores --az for the FSx

In cmd/launch.go:

  • --az sets config.AvailabilityZone, used only for EC2 instance placement (pkg/aws/client.go RunInstances Placement).
  • The FSx-create reads config.SubnetID — which is never assigned in the main launch path (only the separate queue path sets it).
  • So startFSxCreate (pkg/aws/fsx.go) hits its fallback: empty SubnetID → GetSubnets(defaultVPC) → subnets[0], with no AZ filter and no sort.

So --az never reaches the FSx. spawn creates the filesystem in subnets[0] regardless of --az. The field report's three "different AZ" attempts all used the same subnets[0] — which is why the error was identical each time. If that account's subnets[0] AZ happens to be one that doesn't offer PERSISTENT_2 (e.g. a use1-az3-equivalent), every --az fails identically — a pure illusion of per-AZ unavailability.

Second, worse consequence: cross-AZ FSx

The instance honors --az (placement); the FSx uses subnets[0]. When those differ you get an unmountable cross-AZ FSx — FSx Lustre is single-AZ and the mounting instance must share its AZ. A "successful" create in the wrong AZ would then fail to mount.

Fix

Resolve the pinned AZ to a default-VPC subnet before creating the FSx, so it co-locates with the instance:

  • New GetSubnetForAZ(region, az) (pkg/aws/fsx.go) — DescribeSubnets filtered by availability-zone.
  • NeedsAZSubnetResolution(pinnedSubnet, pinnedAZ) pure decision (unit-tested): resolve only when no subnet is pinned AND an AZ is. Explicit subnet still wins; no-AZ-no-subnet keeps the default-VPC fallback.
  • Applied in both cmd/launch.go and pkg/launcher/provision.go (headless).

PR incoming. Probe filesystems all deleted + leak-checked (zero leaks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions