Skip to content

Commit 77f592a

Browse files
author
Sean Smith
committed
Get Mountname from DescribeFileSystems API
For the new FSx FileSystem Types, the mountname changes from always /fsx to a value returned from the API. This is backwards compatible, so the API returns /fsx for `SCRATCH_1` (current default) filesystems. Signed-off-by: Sean Smith <[email protected]>
1 parent ecf2f1f commit 77f592a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

recipes/fsx_mount.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@
3131
action :create
3232
end
3333

34+
require 'chef/mixin/shell_out'
35+
mountname = shell_out("#{node['cfncluster']['cookbook_virtualenv_path']}/bin/aws fsx --region #{node['cfncluster']['cfn_region']} describe-file-systems --file-system-ids #{node['cfncluster']['cfn_fsx_fs_id']} --query 'FileSystems[0].LustreConfiguration.MountName' --output text", :user=>'root').stdout.strip
36+
3437
mount_options = %w[defaults _netdev flock user_xattr noatime]
3538

3639
mount_options.push(%w[noauto x-systemd.automount x-systemd.requires=lnet.service]) if node['init_package'] == 'systemd'
3740

3841
# Mount FSx over NFS
3942
mount fsx_shared_dir do
40-
device "#{node['cfncluster']['cfn_fsx_fs_id']}.fsx.#{node['cfncluster']['cfn_region']}.amazonaws.com@tcp:/fsx"
43+
device "#{node['cfncluster']['cfn_fsx_fs_id']}.fsx.#{node['cfncluster']['cfn_region']}.amazonaws.com@tcp:/#{mountname}"
4144
fstype 'lustre'
4245
dump 0
4346
pass 0

0 commit comments

Comments
 (0)