Repository navigation
Description
Found by the storage leg added to make smoke while verifying #680. The quoting work was fine; this is the failure it surfaced underneath.
Observed
A t4g.small launched with --efs-id in the default VPC, with the mount target available in the same subnet before the launch started:
mount.nfs4: Failed to resolve server fs-0bc771ea6abff6cec.efs.us-east-1.amazonaws.com: Name or service not known
and the mount never happened. Diagnosed on the instance:
| check | result |
|---|---|
/etc/resolv.conf |
nameserver 172.31.0.2 (the VPC resolver), correct |
general DNS (getent hosts s3.amazonaws.com) |
works |
EFS DNS (getent hosts fs-….efs.us-east-1.amazonaws.com) |
fails, still failing many minutes later |
VPC enableDnsSupport / enableDnsHostnames |
both True |
| mount target | available, same subnet, IP 172.31.1.24 |
| mount by IP with the same options | succeeds |
So the filesystem was reachable the whole time. Only the DNS name was not resolving. (The same account, region and subnet resolved EFS DNS correctly earlier the same day, so this is intermittent rather than a permanent account property.)
The gap
pkg/userdata/storage.go issues the mount once:
mount -t nfs4 -o '<opts>' '<fs>.efs.<region>.amazonaws.com':/ '<mountpoint>'A single transient DNS failure at boot therefore fails the mount permanently, even though:
- the mount target's IP is known to spawn at launch time — it is what
aws efs describe-mount-targetsreturns, and the FSx path already resolves a subnet for co-location, so the control plane has this information; - the filesystem becomes reachable seconds later, and nothing retries;
/etc/fstabgets the line regardless, so a latermount -aor reboot would succeed — the failure is specific to the boot attempt.
The consequence is not subtle. With #668's readiness barrier in place, a failed mount now correctly fails the workload rather than running it against a missing directory — so one DNS blip turns into a launch that boots, bills, and runs nothing. That is the right behaviour given the mount failed, but the mount should not have failed.
Suggested fix
In order of preference:
- Retry the mount with backoff — say 6 attempts over ~60s. EFS DNS can lag mount-target creation, and this is the smallest change that fixes the common case.
nfs-utilsis already installed by then. - Fall back to the mount target IP after the DNS attempts fail. spawn can pass the IP in at render time; mounting by IP is what I used to confirm the filesystem was reachable, and it worked first try with the identical options. The trade-off is that an IP in
/etc/fstabdoes not survive a mount-target replacement, so the IP should be the fallback and the DNS name the fstab entry. - Use the
efs-utilshelper (mount -t efs) where available, which handles resolution and TLS itself — a larger change, and it adds a package dependency on a path that currently needs onlynfs-utils.
(1) alone would have made this launch succeed.
Related
- --command still runs BEFORE the storage mounts (EFS/FSx/volumes): #166 fixed --user-data but not --command #668 — the readiness barrier that converts a failed mount into a failed workload instead of a silently wrong one. It behaved correctly here:
/run/spawn/storage-readyreadfailed:not mounted: /efsand the command refused to start, which is how I found this at all rather than seeing a workload produce garbage. - DNS registration burns a hard 4 minutes per launch on
curl exit 6, which is permanent whenever the endpoint hostname does not exist #548 —curl exit 6(DNS failure) classified as transient on the DNS-registration path. Same underlying lesson, different code path: a name that does not resolve yet is usually worth retrying. - The sweep path drops 83 of 127 launch flags by construction — parent of #525/#539/#549/#667/#673/#674/#675 #697 —
--efs-idis dropped entirely on the sweep path, so this cannot currently bite a sweep.
Activity
chore(smoke): make the storage leg opt-in until it has a clean run
chore(smoke): add a storage leg covering the generated mount shell (#705
fix(storage): fall back to the EFS mount-target IP when DNS does not …
fix(storage): retry the EFS mount instead of attempting it once (#704)
fix(storage): fall back to the EFS mount-target IP when DNS does not …
fix(storage): retry the EFS mount, then fall back to the mount-target…
scttfrdmn commentedon Oct 5, 2026
Closed by #712, but with one verification gap I want on the record rather than buried in a merged PR.
What is verified on hardware
The reported symptom — the mount attempted exactly once — is fixed and confirmed by a real run. The storage smoke leg now passes 4/4, with
/run/spawn/storage-readyreadingok,/efspresent in/proc/mounts, and$EFS_MOUNT=/efsafter sourcing the generated profile.What is not
The mount-target IP fallback has never actually run on an instance. In the green run, DNS resolved on the first attempt, so the fallback was never reached — no
attempt N/6 failedlines and nomounting by mount-target IP insteadincloud-init-output.log. It is verified only by an executable shell test that stubsmountto fail for the DNS name and succeed for the IP.That is a direct consequence of the failure being intermittent, which also corrects something I asserted mid-investigation. Three runs:
I had claimed, after run 2, that EFS DNS propagation "outlasts any retry budget worth spending" — i.e. that it was reliably broken for new mount targets. Run 3 shows that was over-stated: it is unreliable, not broken. Your original "intermittent rather than a permanent account property" framing was closer than my correction to it.
What survives unchanged is the operational conclusion, and it is the reason the fallback went in: when DNS fails it fails for the entire 60-second budget. Two runs out of three would have left a workload with no data. A retry that recovers in neither failing case is not a fix.
The awkward part
Because the failure is intermittent, a green smoke is not evidence the fallback works — only a run that happens to hit the DNS failure exercises it, and that cannot be scheduled. So the hardware-sensitivity manifest flagging
pkg/userdata/will keep demanding a smoke for this path, and a passing smoke will keep not answering the question.The honest way to close that gap is one run with a deliberately unresolvable DNS name injected into the template, so the fallback is forced. I have not done it: it means shipping a knowingly-broken value to an instance, which is worth agreeing before doing rather than slipping into a test run.
Reopen if you would rather that proof existed before this counts as closed.
chore(release): v0.121.0
fix(storage): mount EFS by the mount-target IP first, DNS second (#718)…
chore(release): v0.122.0