Skip to content

Commit 3061f01

Browse files
committed
[Storage] Fix sporadic NFS server start failure by using dynamic port assignment for all NFS services: statd, statd_out, mountd, lockd, rquotad.
1 parent b684a27 commit 3061f01

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ aws-parallelcluster-cookbook CHANGELOG
33

44
This file is used to list changes made in each version of the AWS ParallelCluster cookbook.
55

6+
3.16.0
7+
------
8+
9+
**CHANGES**
10+
- Reduce the risk of NFS server start failure by using dynamic port assignment for all NFS services: statd, statd_out, mountd, lockd, rquotad.
11+
612
3.15.0
713
------
814

cookbooks/aws-parallelcluster-environment/attributes/environment.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
default['cluster']['proxy'] = 'NONE'
44

5+
# Use dynamic port assignment for all NFS services to avoid EADDRINUSE collisions
6+
# with the Linux ephemeral port range (32768-60999). The upstream NFS cookbook defaults
7+
# (32765-32769) overlap with or sit adjacent to this range, causing sporadic boot failures.
8+
# PCluster doesn't need static NFS ports — nodes communicate within a VPC using security groups.
9+
default['nfs']['port']['statd'] = 0
10+
default['nfs']['port']['statd_out'] = 0
11+
default['nfs']['port']['mountd'] = 0
12+
default['nfs']['port']['lockd'] = 0
13+
default['nfs']['port']['rquotad'] = 0
14+
515
# For performance, set NFS threads to min(256, max(8, num_cores * 4))
616
default['cluster']['nfs']['threads'] = [[node['cpu']['cores'].to_i * 4, 8].max, 256].min
717

cookbooks/aws-parallelcluster-environment/spec/unit/resources/nfs_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ def self.configure(chef_run)
1818
end
1919
end
2020

21+
describe 'nfs:port_overrides' do
22+
# Verify that all NFS service ports are overridden to 0 (dynamic assignment)
23+
# to avoid EADDRINUSE collisions with the Linux ephemeral port range (32768-60999).
24+
# The upstream NFS cookbook defaults (32765-32769) overlap with or sit adjacent to
25+
# this range, causing sporadic NFS server start failures during boot.
26+
cached(:chef_run) { ChefSpec::SoloRunner.new.converge('aws-parallelcluster-environment') }
27+
cached(:node) { chef_run.node }
28+
29+
%w(statd statd_out mountd lockd rquotad).each do |service|
30+
it "overrides nfs port for #{service} to 0 (dynamic)" do
31+
expect(node['nfs']['port'][service]).to eq(0)
32+
end
33+
end
34+
end
35+
2136
describe 'nfs:setup' do
2237
for_all_oses do |platform, version|
2338
context "on #{platform}#{version}" do

0 commit comments

Comments
 (0)