Repository navigation
fix: --fsx-create honors --az by resolving it to a co-located subnet (#208) - #209
Merged
Merged
Conversation
…208) --az set the EC2 instance placement but never reached the FSx create, which fell back to subnets[0] of the default VPC regardless of --az. Two bugs: 1. The FSx could land in a different AZ than the instance — an unmountable cross-AZ FSx (Lustre is single-AZ; the mounting instance must share its AZ). 2. On accounts whose subnets[0] AZ doesn't offer PERSISTENT_2, EVERY --az value failed identically with 'PERSISTENT_2 is not available in this availability zone' — a per-AZ-availability illusion that was really the same wrong subnet each time. Verified via a direct CreateFileSystem probe (2 runs, all 6 us-east-1 AZs, deleted + leak-checked): AWS accepts PERSISTENT_2 in 5/6 AZs including the reported-failing 1a/1b/1c. Fix: resolve a pinned --az to a default-VPC subnet (GetSubnetForAZ) before creating the FSx, so it co-locates with the instance. NeedsAZSubnetResolution is the pure, unit-tested decision (resolve iff no subnet pinned AND an AZ is). Applied in both cmd/launch.go and pkg/launcher/provision.go (headless). An explicit pinned subnet still wins; no-AZ-no-subnet keeps the default fallback. Closes #208
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #208.
The bug
--azset the EC2 instance placement but never reached the FSx create.cmd/launch.gopassesconfig.SubnetIDto the FSx config, butconfig.SubnetIDis never assigned in the main launch path — sostartFSxCreatefell back tosubnets[0]of the default VPC, ignoring--azentirely.Two consequences:
--az, the FSx usedsubnets[0]; if they differ, the mount can't work (FSx Lustre is single-AZ).PERSISTENT_2 is not available in this availability zoneon--az us-east-1a,1b,1c, identical text each time. They were all the samesubnets[0], not three AZs. On an account whosesubnets[0]AZ doesn't offer PERSISTENT_2, every--azfails identically.Proof it's not AWS
Direct
CreateFileSystemPERSISTENT_2 probe (raw CLI, explicit subnet per AZ, deleted + leak-checked), two runs, all 6 us-east-1 AZs:AWS accepts PERSISTENT_2 in the exact AZs the report "failed" on (also verified with LZ4 compression and 125/250 throughput — all succeed).
Fix
GetSubnetForAZ(region, az)(pkg/aws/fsx.go) — DescribeSubnets filtered byavailability-zonein the default VPC.NeedsAZSubnetResolution(pinnedSubnet, pinnedAZ)— pure, unit-tested decision: resolve iff no subnet is pinned and an AZ is. Explicit subnet wins; no-AZ-no-subnet keeps the default-VPC fallback (matching the instance's own unpinned placement).cmd/launch.goandpkg/launcher/provision.go(headless / lagotto), so the FSx co-locates with the instance's AZ.Tests
TestNeedsAZSubnetResolutiontable test (4 cases).go build ./...,go vet,pkg/aws+pkg/launchersuites green; gofmt clean.