Repository navigation
Description
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:
--azsetsconfig.AvailabilityZone, used only for EC2 instance placement (pkg/aws/client.goRunInstancesPlacement).- The FSx-create reads
config.SubnetID— which is never assigned in the main launch path (only the separatequeuepath sets it). - So
startFSxCreate(pkg/aws/fsx.go) hits its fallback: emptySubnetID→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 byavailability-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.goandpkg/launcher/provision.go(headless).
PR incoming. Probe filesystems all deleted + leak-checked (zero leaks).
Activity
fix: --fsx-create honors --az by resolving it to a co-located subnet (#…
chore(release): v0.59.0
refactor: create ephemeral FSx after RunInstances succeeds (#213) (#215)