Skip to content

Commit 3327d1f

Browse files
committed
Improve Lustre client installation for CentOS
Add new records to handle mapping between the Lustre repository and the CentOS kernel version, as described in https://docs.aws.amazon.com/fsx/latest/LustreGuide/install-lustre-client.html New AMI for CentOS 7.9 was released on November 10 2020 (e.g. ami-00e87074e52e6c9f9 in us-east-1) New AMI for CentOS 8.3 will be released soon Signed-off-by: Luca Carrogu <[email protected]>
1 parent a4e8406 commit 3327d1f

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

attributes/default.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@
335335
default['cfncluster']['lustre']['base_url'] = value_for_platform(
336336
'centos' => {
337337
# node['kernel']['machine'] contains the architecture: 'x86_64' or 'aarch64'
338-
'>=8' => "https://fsx-lustre-client-repo.s3.amazonaws.com/el/8/#{node['kernel']['machine']}/",
339-
'default' => "https://fsx-lustre-client-repo.s3.amazonaws.com/el/7.#{find_rhel7_kernel_minor_version}/x86_64/"
338+
'>=8' => "https://fsx-lustre-client-repo.s3.amazonaws.com/el/8#{find_rhel_minor_version}/#{node['kernel']['machine']}/",
339+
'default' => "https://fsx-lustre-client-repo.s3.amazonaws.com/el/7#{find_rhel_minor_version}/x86_64/"
340340
},
341341
'ubuntu' => { 'default' => "https://fsx-lustre-client-repo.s3.amazonaws.com/ubuntu" }
342342
)

libraries/helpers.rb

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -315,23 +315,34 @@ def aws_domain
315315
end
316316

317317
#
318-
# Retrieve RHEL kernel minor version from running kernel
319-
# The minor version is retrieved from the patch version of the running kernel
318+
# Retrieve RHEL OS minor version from running kernel version
319+
# The OS minor version is retrieved from the patch version of the running kernel
320320
# following the mapping reported here https://access.redhat.com/articles/3078#RHEL7
321-
# Method works for minor version >=7
321+
# Method works for CentOS8 minor version >=2 and CentOS7 minor version >=7
322322
#
323-
def find_rhel7_kernel_minor_version
324-
kernel_minor_version = '7'
323+
def find_rhel_minor_version
324+
os_minor_version = ''
325325

326326
if node['platform'] == 'centos'
327327
# kernel release is in the form 3.10.0-1127.8.2.el7.x86_64
328328
kernel_patch_version = node['kernel']['release'].match(/^\d+\.\d+\.\d+-(\d+)\..*$/)
329-
raise "Unable to retrieve the kernel minor version from #{node['kernel']['release']}." unless kernel_patch_version
330-
331-
kernel_minor_version = '8' if kernel_patch_version[1] >= '1127'
329+
raise "Unable to retrieve the kernel patch version from #{node['kernel']['release']}." unless kernel_patch_version
330+
331+
# Lustre repo string will be built following the official doc
332+
# https://docs.aws.amazon.com/fsx/latest/LustreGuide/install-lustre-client.html
333+
if node['platform_version'].to_i == 7
334+
os_minor_version = '.7' if kernel_patch_version[1] >= '1062'
335+
os_minor_version = '.8' if kernel_patch_version[1] >= '1127'
336+
os_minor_version = '.9' if kernel_patch_version[1] >= '1160'
337+
elsif node['platform_version'].to_i == 8
338+
os_minor_version = '.2' if kernel_patch_version[1] >= '193'
339+
os_minor_version = '.3' if kernel_patch_version[1] >= '240'
340+
else
341+
raise "CentOS version #{node['platform_version']} not supported."
342+
end
332343
end
333344

334-
kernel_minor_version
345+
os_minor_version
335346
end
336347

337348
# Return chrony service reload command

0 commit comments

Comments
 (0)