Order FSx automount after configure-efa-fsx-lustre-client.service when EFA is configured - #1208
Conversation
…n EFA is configured The FSx Lustre automount in mount_fsx.sh is ordered only on network-online.target. When EFA is configured for the client, the automount can therefore fire before configure-efa-fsx-lustre-client.service has finished setting up the EFA LNet transport, so the mount comes up over TCP even on a node where EFA was meant to be active. Add x-systemd.after=configure-efa-fsx-lustre-client.service to the mount options, but only when this run actually configured EFA (EFA_CONFIGURED=true). Use after= (ordering only) rather than the requires= form suggested by the FSx docs on purpose: requires= would fail the mount entirely if the EFA config service fails (losing the safe TCP fallback), and would pull the service in even when an operator has deliberately disabled it (e.g. running EFA-off as a mitigation). after= gives correct ordering when EFA is on, is a no-op when the service is disabled/masked, and preserves TCP fallback.
Can you confirm you have performed this verification? Additionally, can you also test backward compat: mask configure-efa-fsx-lustre-client.service, reboot, and confirm the mount still succeeds over TCP. |
|
@svnisar Both verifications are now done on a real HyperPod Slurm cluster. Summary below, full logs available. Environment: HyperPod Slurm cluster (controller ml.c5.4xlarge + worker ml.g6.16xlarge), provisioned end-to-end with this PR branch's 1. Full on-node reboot verification (EFA path)After Without the Post-reboot the mount runs over EFA/LNet, not TCP (mount success alone can't distinguish the two, so quoting NIDs and counters): ( 2. Backward compat (service masked → TCP fallback)Masked the service, rebooted. The unit never ran this boot ( So Two operational notes from the runs, for anyone reproducing:
Updating the PR description's test plan section with these results. |
Purpose
mount_fs()inmount_fsx.shmounts FSx for Lustre withx-systemd.automountordered only onnetwork-online.target. When EFA is configured for the client (viaconfigure_efa_lustre()→configure-efa-fsx-lustre-client.service), the automount can fire before that service finishes setting up the EFA LNet transport. The filesystem then comes up over TCP even on a node where EFA was meant to be active, with no visible error.This gap was surfaced by the SageMaker support team while triaging a HyperPod + EFA-enabled FSx for Lustre incident: nodes did not always come back cleanly on reboot, and the automount had no ordering dependency on the EFA client configuration. The FSx documentation for EFA-enabled filesystems does recommend adding such a dependency (mount-fs-auto-mount-onreboot).
Changes
mount_fs(), build the mount options into a variable and, only whenEFA_CONFIGURED=true, appendx-systemd.after=configure-efa-fsx-lustre-client.service.Why
after=and notrequires=The FSx docs suggest
x-systemd.requires=configure-efa-fsx-lustre-client.service. This PR deliberately usesx-systemd.after=(ordering only) instead, becauserequires=:requires=dependency would try to start the disabled service back up, fighting that operational choice.after=gives the correct ordering when EFA is on, is a no-op when the service is disabled/masked, and preserves TCP fallback if configuration fails. To turn EFA off operationally, disable (or mask)configure-efa-fsx-lustre-client.service; the mount still succeeds over TCP.Relationship to #1204
Complementary, non-overlapping. #1204 hardens the service side (retries the IMDS query so
configure-efa-fsx-lustre-client.servicedoesn't fail on a boot-time IMDS race). This PR fixes the mount side (orders the automount after that service so it doesn't race ahead of EFA setup). Together they make reboot recovery behave like a fresh lifecycle run for FSx+EFA nodes. Neither depends on the other; they touch different parts ofmount_fsx.shand can merge in either order.Test Plan
Environment: SageMaker HyperPod (Slurm), FSx for Lustre created with EFA enabled; EFA-capable GPU instances.
Commands:
Results so far:
bash -npasses.EFA_CONFIGURED=trueappendsx-systemd.after=configure-efa-fsx-lustre-client.service.x-systemd.after=ordering held the mount until the service finished; the mount came up with an@efaNID and EFA LNet counters moving under direct I/O. Backward compat also verified: withconfigure-efa-fsx-lustre-client.servicemasked, reboot → mount succeeds immediately over TCP (tcp-only NIDs). Full logs: verification comment.Credit
Thanks to the SageMaker support engineer who flagged the missing automount → EFA-config ordering dependency during incident triage.
Checklist
mainbranch.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.