diff --git a/cookbooks/aws-parallelcluster-config/recipes/base.rb b/cookbooks/aws-parallelcluster-config/recipes/base.rb index bdf3dbd17..82b2b5e60 100644 --- a/cookbooks/aws-parallelcluster-config/recipes/base.rb +++ b/cookbooks/aws-parallelcluster-config/recipes/base.rb @@ -27,16 +27,23 @@ include_recipe 'aws-parallelcluster-config::nfs' unless virtualized? -service "setup-ephemeral" do - supports restart: false - action :enable -end +# Mount the ephemeral drive unless there is a mountpoint collision with shared drives +shared_dir_array = node['cluster']['ebs_shared_dirs'].split(',') + \ + node['cluster']['efs_shared_dirs'].split(',') + \ + node['cluster']['fsx_shared_dirs'].split(',') + \ + [ node['cluster']['raid_shared_dir'] ] +unless shared_dir_array.include? node['cluster']['ephemeral_dir'] + service "setup-ephemeral" do + supports restart: false + action :enable + end -# Execution timeout 3600 seconds -unless virtualized? - execute "Setup of ephemeral drivers" do - user "root" - command "/usr/local/sbin/setup-ephemeral-drives.sh" + # Execution timeout 3600 seconds + unless virtualized? + execute "Setup of ephemeral drives" do + user "root" + command "/usr/local/sbin/setup-ephemeral-drives.sh" + end end end diff --git a/cookbooks/aws-parallelcluster-test/recipes/tests.rb b/cookbooks/aws-parallelcluster-test/recipes/tests.rb index 61b933cab..2a358f276 100644 --- a/cookbooks/aws-parallelcluster-test/recipes/tests.rb +++ b/cookbooks/aws-parallelcluster-test/recipes/tests.rb @@ -334,9 +334,25 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit ################### # instance store ################### -bash 'test instance store' do - cwd Chef::Config[:file_cache_path] - code <<-EPHEMERAL + +ebs_shared_dirs_array = node['cluster']['ebs_shared_dirs'].split(',') + +if ebs_shared_dirs_array.include? node['cluster']['ephemeral_dir'] + # In this case the ephemeral storage should not be mounted because the mountpoint + # clashes with the mountpoint coming from t + bash 'test instance store mountpoint collision' do + cwd Chef::Config[:file_cache_path] + user node['cluster']['cluster_user'] + code <<-COLLISION + systemctl show setup-ephemeral.service -p ActiveState | grep "=inactive" + systemctl show setup-ephemeral.service -p UnitFileState | grep "=disabled" + COLLISION + end +else + bash 'test instance store' do + cwd Chef::Config[:file_cache_path] + user node['cluster']['cluster_user'] + code <<-EPHEMERAL set -xe EPHEMERAL_DIR="#{node['cluster']['ephemeral_dir']}" @@ -389,11 +405,11 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit mkdir -p ${EPHEMERAL_DIR}/test_dir touch ${EPHEMERAL_DIR}/test_dir/test_file fi - EPHEMERAL - user node['cluster']['cluster_user'] -end -execute 'check setup-ephemeral service is enabled' do - command "systemctl is-enabled setup-ephemeral" + EPHEMERAL + end + execute 'check setup-ephemeral service is enabled' do + command "systemctl is-enabled setup-ephemeral" + end end ###################