Recent fixes
cover Recent fixes
From: Chuck Lever <[email protected]>
This series is a handful of loosely related patches that I wrote while trying to get kdevops operational on AWS again, for use with NFS workflows. Note that there are still one or two more issues that need to be tracked down before AWS will be working well for me.
These might also be useful for OCI or other cloud providers.
Please have a look. I'm happy to make changes or drop one or two of these if needed.
Chuck Lever (6):
fstests: Fix NFS mount options for fstests
gen_nodes: Fix generation of the list of test nodes
fstests: Fix selection of NFSD export type for the pNFS test section
NFSD: Implement NVMe storage for NFSD exports
playbooks: Add a Code Ready Builder role
codereadyrepo: Enable codeready-builder in AWS
kconfigs/Kconfig.nfsd | 12 ++++-- .../roles/codereadyrepo/defaults/main.yml | 5 +++ playbooks/roles/codereadyrepo/tasks/main.yml | 37 +++++++++++++++++++ .../tasks/install-deps/redhat/main.yml | 14 +------ playbooks/roles/fstests/tasks/main.yml | 1 + .../roles/fstests/templates/nfs/nfs.config | 4 +- playbooks/roles/gen_nodes/tasks/gitr.yml | 4 +- playbooks/roles/gen_nodes/tasks/ltp.yml | 4 +- playbooks/roles/gen_nodes/tasks/nfstest.yml | 4 +- playbooks/roles/nfsd/defaults/main.yml | 1 + playbooks/roles/nfsd/tasks/main.yml | 31 +++++++++++++--- .../pynfs/tasks/install-deps/redhat/main.yml | 14 +------ .../tasks/install-deps/redhat/main.yml | 14 +------ scripts/nfsd.Makefile | 4 ++ 14 files changed, 96 insertions(+), 53 deletions(-) create mode 100644 playbooks/roles/codereadyrepo/defaults/main.yml create mode 100644 playbooks/roles/codereadyrepo/tasks/main.yml
Signature · 1 line
2.47.0
PATCH 1/6 fstests: Fix NFS mount options for fstests
From: Chuck Lever <[email protected]>
If the NFS mount command line does not specify an NFS version, the client uses the default protocol version , which for recent versions of nfs-utils, is NFSv4.2.
I noticed the NFS test sections in our nfs.config file specifies the NFS version for the test partition, but not the scratch partition. This is throwing off the feature test macros in fstests, so it is testing, say, xattrs, on NFSv4.1 mounts, and failing 100% of the time.
Ensure that the test and scratch partitions use the same NFS version.
--- playbooks/roles/fstests/templates/nfs/nfs.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
playbooks/roles/fstests/templates/nfs/nfs.config +2 -2
@@ -21,14 +21,14 @@ MOUNT_OPTIONS="-o vers=4.1" # Test over RDMA [nfs_rdma] -TEST_FS_MOUNT_OPTS="-o rdma" +TEST_FS_MOUNT_OPTS="-o rdma,vers=4.1" MOUNT_OPTIONS="-o rdma,vers=4.1" {% endif %} {% if fstests_nfs_section_tls -%} # Test NFS with RPC over TLS [nfs_tls] -TEST_FS_MOUNT_OPTS="-o xprtsec=mtls" +TEST_FS_MOUNT_OPTS="-o xprtsec=mtls,vers=4.1" MOUNT_OPTIONS="-o xprtsec=mtls,vers=4.1" {% endif %} {% if fstests_nfs_section_nfsd -%}
Signature · 1 line
2.47.0
PATCH 2/6 gen_nodes: Fix generation of the list of test nodes
In reply to [email protected]From: Chuck Lever <[email protected]>
Terraform was getting an incorrect list of instances to create. The new workflows I added got the node list generation wrong.
--- playbooks/roles/gen_nodes/tasks/gitr.yml | 4 ++-- playbooks/roles/gen_nodes/tasks/ltp.yml | 4 ++-- playbooks/roles/gen_nodes/tasks/nfstest.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
playbooks/roles/gen_nodes/tasks/gitr.yml +2 -2
@@ -25,8 +25,8 @@ - name: Generate the kdevops nodes file using {{ kdevops_nodes_template }} vars: node_template: "{{ kdevops_nodes_template | basename }}" - all_generic_nodes: "{{ generic_nodes }}" - nodes: "{{ [kdevops_host_prefix + '-'] | product(gitr_enabled_nodes) | map('join') | list }}" + all_generic_nodes: "{{ [kdevops_host_prefix + '-'] | product(gitr_enabled_nodes) | map('join') | list }}" + nodes: "{{ all_generic_nodes }}" ansible.builtin.template: src: "{{ node_template }}" dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
playbooks/roles/gen_nodes/tasks/ltp.yml +2 -2
@@ -13,8 +13,8 @@ - name: Generate the kdevops nodes file using {{ kdevops_nodes_template }} vars: node_template: "{{ kdevops_nodes_template | basename }}" - all_generic_nodes: "{{ generic_nodes }}" - nodes: "{{ [kdevops_host_prefix + '-'] | product(ltp_enabled_nodes) | map('join') | list }}" + all_generic_nodes: "{{ [kdevops_host_prefix + '-'] | product(ltp_enabled_nodes) | map('join') | list }}" + nodes: "{{ all_generic_nodes }}" ansible.builtin.template: src: "{{ node_template }}" dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
playbooks/roles/gen_nodes/tasks/nfstest.yml +2 -2
@@ -25,8 +25,8 @@ - name: Generate the kdevops nodes file using {{ kdevops_nodes_template }} vars: node_template: "{{ kdevops_nodes_template | basename }}" - all_generic_nodes: "{{ generic_nodes }}" - nodes: "{{ [kdevops_host_prefix + '-'] | product(nfstest_enabled_nodes) | map('join') | list }}" + all_generic_nodes: "{{ [kdevops_host_prefix + '-'] | product(nfstest_enabled_nodes) | map('join') | list }}" + nodes: "{{ all_generic_nodes }}" ansible.builtin.template: src: "{{ node_template }}" dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
Signature · 1 line
2.47.0
PATCH 3/6 fstests: Fix selection of NFSD export type for the pNFS test section
In reply to [email protected]From: Chuck Lever <[email protected]>
I noticed this task was unnecessarily triggered for non-NFS file system types.
--- playbooks/roles/fstests/tasks/main.yml | 1 + 1 file changed, 1 insertion(+)
playbooks/roles/fstests/tasks/main.yml +1 -0
@@ -748,6 +748,7 @@ set_fact: fstests_nfs_export_fstype: "xfs" when: + - fstests_fstyp == "nfs" - fstests_nfs_section_pnfs|bool - name: Create NFS export for test vol
Signature · 1 line
2.47.0
PATCH 4/6 NFSD: Implement NVMe storage for NFSD exports
In reply to [email protected]From: Chuck Lever <[email protected]>
--- kconfigs/Kconfig.nfsd | 12 +++++++--- playbooks/roles/nfsd/defaults/main.yml | 1 + playbooks/roles/nfsd/tasks/main.yml | 31 +++++++++++++++++++++----- scripts/nfsd.Makefile | 4 ++++ 4 files changed, 39 insertions(+), 9 deletions(-)
kconfigs/Kconfig.nfsd +9 -3
@@ -67,14 +67,14 @@ config NFSD_LEASE_TIME complete faster. choice - prompt "Local or external physical storage" + prompt "Persistent storage for exported file systems" default NFSD_EXPORT_STORAGE_LOCAL config NFSD_EXPORT_STORAGE_LOCAL bool "Local" help Exported file systems will reside on physical storage - local to the NFS server itself. + devices local to the NFS server itself. config NFSD_EXPORT_STORAGE_ISCSI bool "iSCSI"
@@ -83,12 +83,18 @@ config NFSD_EXPORT_STORAGE_ISCSI located on a separate target node and accessed via iSCSI. +config NFSD_EXPORT_STORAGE_NVME + bool "NVMe" + help + Exported file systems will reside in NVMe namespaces + local to the NFS server itself. + endchoice if NFSD_EXPORT_STORAGE_LOCAL config NFSD_EXPORT_DEVICE_PREFIX - string "The device prefix to use for LVM PVs" + string "The block device name prefix to use for LVM PVs" default "/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_NVME default "/dev/disk/by-id/virtio-kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_VIRTIO default "/dev/disk/by-id/ata-QEMU_HARDDISK_kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_IDE
playbooks/roles/nfsd/defaults/main.yml +1 -0
@@ -10,5 +10,6 @@ nfsd_lease_time: "90" nfsd_export_storage_local: false nfsd_export_storage_iscsi: false +nfsd_export_storage_nvme: false kdevops_krb5_enable: false
playbooks/roles/nfsd/tasks/main.yml +25 -6
@@ -29,7 +29,7 @@ when: - nfsd_export_storage_iscsi|bool -- name: Build string of devices to use as PVs +- name: Build a list of block devices to provision as PVs set_fact: nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [ nfsd_export_device_prefix + item|string ] }}" with_items: "{{ range(1, nfsd_export_device_count + 1) }}"
@@ -38,15 +38,34 @@ when: - nfsd_export_storage_local|bool -- name: Create a new LVM VG - become: yes - become_flags: 'su - -c' - become_method: sudo +- name: Enumerate NVMe devices to provision as PVs + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.command: + cmd: "lsblk -np -o PATH,SERIAL" + register: lsblk_output + changed_when: false + when: + - nfsd_export_storage_nvme|bool + +- name: Build a list of NVMe devices to provision as PVs + ansible.builtin.set_fact: + nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [item | split() | first] }}" + loop: "{{ lsblk_output.stdout_lines }}" + when: + - nfsd_export_storage_nvme|bool + - '"AWS" in item' + +- name: Create a new LVM Volume Group + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo community.general.lvg: vg: "exports" pvs: "{{ nfsd_lvm_pvs | join(',') }}" when: - - nfsd_export_storage_local|bool + - nfsd_export_storage_local|bool or nfsd_export_storage_nvme|bool - name: Create {{ nfsd_export_path }} become: yes
scripts/nfsd.Makefile +4 -0
@@ -10,6 +10,10 @@ ifeq (y,$(CONFIG_NFSD_EXPORT_STORAGE_ISCSI)) NFSD_EXTRA_ARGS += nfsd_export_storage_iscsi=true endif +ifeq (y,$(CONFIG_NFSD_EXPORT_STORAGE_NVME)) +NFSD_EXTRA_ARGS += nfsd_export_storage_nvme=true +endif + ifeq (y,$(CONFIG_FSTESTS_NFS_SECTION_NFSD)) NFSD_EXTRA_ARGS += kdevops_loopback_nfs_enable=true endif
Signature · 1 line
2.47.0
Re: [PATCH 4/6] NFSD: Implement NVMe storage for NFSD exports
Quoted 20 lines · On Tue, Dec 10, 2024 at 02:29:17PM -0500, [email protected] wrote:
playbooks/roles/nfsd/tasks/main.yml +8
-4@@ -38,15 +38,34 @@ when: - nfsd_export_storage_local|bool -- name: Create a new LVM VG - become: yes - become_flags: 'su - -c' - become_method: sudo +- name: Enumerate NVMe devices to provision as PVs + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.command: + cmd: "lsblk -np -o PATH,SERIAL" + register: lsblk_output + changed_when: false
playbooks/roles/nfsd/tasks/main.yml line 58
Quoted 10 lines
playbooks/roles/nfsd/tasks/main.yml +10
-0+ when: + - nfsd_export_storage_nvme|bool + +- name: Build a list of NVMe devices to provision as PVs + ansible.builtin.set_fact: + nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [item | split() | first] }}" + loop: "{{ lsblk_output.stdout_lines }}" + when: + - nfsd_export_storage_nvme|bool + - '"AWS" in item'
I think you may want to add a new output yaml for when the provider is AWS so you get devops_terraform_provider_is_aws so you can just check for that here as an extra bool. That will ensure with more determinism that the bringup is on AWS.
Luis
Re: [PATCH 4/6] NFSD: Implement NVMe storage for NFSD exports
Quoted 28 lines · Luis Chamberlain
Quoted 27 lines · On Tue, Dec 10, 2024 at 02:29:17PM -0500, [email protected] wrote:
playbooks/roles/nfsd/tasks/main.yml +15
-4@@ -38,15 +38,34 @@ when: - nfsd_export_storage_local|bool -- name: Create a new LVM VG - become: yes - become_flags: 'su - -c' - become_method: sudo +- name: Enumerate NVMe devices to provision as PVs + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.command: + cmd: "lsblk -np -o PATH,SERIAL" + register: lsblk_output + changed_when: false + when: + - nfsd_export_storage_nvme|bool + +- name: Build a list of NVMe devices to provision as PVs + ansible.builtin.set_fact: + nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [item | split() | first] }}" + loop: "{{ lsblk_output.stdout_lines }}"
Quoted 8 lines
playbooks/roles/nfsd/tasks/main.yml line 58
Quoted 3 lines
playbooks/roles/nfsd/tasks/main.yml +3
-0+ when: + - nfsd_export_storage_nvme|bool + - '"AWS" in item'I think you may want to add a new output yaml for when the provider is AWS so you get
devops_terraform_provider_is_awsso you can just check for that here as an extra bool. That will ensure with more determinism that the bringup is on AWS.
Apologies for asking, but do you have a particular commit ID or file I could use as an example?
Signature · 1 line
Chuck Lever
Re: [PATCH 4/6] NFSD: Implement NVMe storage for NFSD exports
Quoted 37 lines · Chuck Lever
Quoted 27 lines · Luis Chamberlain
Quoted 26 lines · On Tue, Dec 10, 2024 at 02:29:17PM -0500, [email protected] wrote:
playbooks/roles/nfsd/tasks/main.yml +15
-4@@ -38,15 +38,34 @@ when: - nfsd_export_storage_local|bool -- name: Create a new LVM VG - become: yes - become_flags: 'su - -c' - become_method: sudo +- name: Enumerate NVMe devices to provision as PVs + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.command: + cmd: "lsblk -np -o PATH,SERIAL" + register: lsblk_output + changed_when: false + when: + - nfsd_export_storage_nvme|bool + +- name: Build a list of NVMe devices to provision as PVs + ansible.builtin.set_fact: + nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [item | split() | first] }}" + loop: "{{ lsblk_output.stdout_lines }}"Quoted 8 lines
playbooks/roles/nfsd/tasks/main.yml line 57
Quoted 3 lines
playbooks/roles/nfsd/tasks/main.yml +3
-0+ when: + - nfsd_export_storage_nvme|bool + - '"AWS" in item'I think you may want to add a new output yaml for when the provider is AWS so you get
devops_terraform_provider_is_awsso you can just check for that here as an extra bool. That will ensure with more determinism that the bringup is on AWS.
Quoted 2 lines
Apologies for asking, but do you have a particular commit ID or file I could use as an example?
I mean like this:
terraform/Kconfig.providers +4 -0
@@ -5,6 +5,7 @@ choice config TERRAFORM_GCE bool "GCE - Google Cloud Engine" depends on TARGET_ARCH_X86_64 + output yaml help Enabling this means you are going to use GCE for your cloud solution.
@@ -18,6 +19,7 @@ config TERRAFORM_AZURE bool "Azure" depends on TARGET_ARCH_X86_64 select TERRAFORM_PRIVATE_NET + output yaml help Enabling this means you are going to use Azure for your cloud solution. Note that Azure requires a private network for the
@@ -26,12 +28,14 @@ config TERRAFORM_AZURE config TERRAFORM_OCI bool "OCI - Oracle Cloud Infrastructure" depends on TARGET_ARCH_X86_64 + output yaml help Enabling this means you are going to use OCI for your cloud solution. config TERRAFORM_OPENSTACK bool "OpenStack" + output yaml help Enabling this means you are going to use OpenStack for your cloud solution.
Then with this your task becomes more deterministic like this:
- name: Build a list of NVMe devices to provision as PVs ansible.builtin.set_fact:
nfsd_lvm_pvs: "{{ nfsd_lvm_pvs + [item | split() | first] }}" loop: "{{ lsblk_output.stdout_lines }}"
when:
- nfsd_export_storage_nvme|bool
- terraform_aws|bool
- '"AWS" in item'
PATCH 5/6 playbooks: Add a Code Ready Builder role
In reply to [email protected]From: Chuck Lever <[email protected]>
Installing Code Ready Builder turns out to be complicated by the way the package is named on various cloud providers. Since there is more than one workflow that wants to install CRB, move the installation mechanism to its own role so that can be included in each workflow that might need it.
--- playbooks/roles/codereadyrepo/tasks/main.yml | 14 ++++++++++++++ .../fstests/tasks/install-deps/redhat/main.yml | 14 ++------------ .../roles/pynfs/tasks/install-deps/redhat/main.yml | 14 ++------------ .../sysbench/tasks/install-deps/redhat/main.yml | 14 ++------------ 4 files changed, 20 insertions(+), 36 deletions(-) create mode 100644 playbooks/roles/codereadyrepo/tasks/main.yml
playbooks/roles/codereadyrepo/tasks/main.yml new file +14 -0
@@ -0,0 +1,14 @@ +--- +- name: Enable the CodeReady repo + become: yes + ansible.builtin.command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms + when: + - ansible_distribution == 'RedHat' + - not devconfig_custom_yum_repofile + +- name: Enable the CodeReady repo + become: yes + ansible.builtin.command: /usr/bin/dnf config-manager --enable crb + when: + - ansible_distribution == 'CentOS' + - not devconfig_custom_yum_repofile
playbooks/roles/fstests/tasks/install-deps/redhat/main.yml +2 -12
@@ -1,17 +1,7 @@ --- - name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms - when: - - ansible_distribution == 'RedHat' - - not devconfig_custom_yum_repofile - -- name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable crb - when: - - ansible_distribution == 'CentOS' - - not devconfig_custom_yum_repofile + ansible.builtin.include_role: + name: codereadyrepo - name: Install epel-release if we're not on Fedora become: yes
playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml +2 -12
@@ -1,17 +1,7 @@ --- - name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms - when: - - ansible_distribution == 'RedHat' - - not devconfig_custom_yum_repofile - -- name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable crb - when: - - ansible_distribution == 'CentOS' - - not devconfig_custom_yum_repofile + ansible.builtin.include_role: + name: codereadyrepo - name: Install build dependencies for pynfs become: yes
playbooks/roles/sysbench/tasks/install-deps/redhat/main.yml +2 -12
@@ -1,17 +1,7 @@ --- - name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms - when: - - ansible_distribution == 'RedHat' - - not devconfig_custom_yum_repofile - -- name: Enable the CodeReady repo - become: yes - command: /usr/bin/dnf config-manager --enable crb - when: - - ansible_distribution == 'CentOS' - - not devconfig_custom_yum_repofile + ansible.builtin.include_role: + name: codereadyrepo - name: Install epel-release if we're not on Fedora become: yes
Signature · 1 line
2.47.0
PATCH 6/6 codereadyrepo: Enable codeready-builder in AWS
In reply to [email protected]From: Chuck Lever <[email protected]>
Running "make pynfs" against an AWS EC2 instance fails with:
Error: No matching repo to modify: codeready-builder-for-rhel-9-x86_64-rpms.
Adjust the logic in the codereadyrepo playbook to sketch in what might be needed for running the pynfs workflow in AWS.
Similar adjustments might be necessary for other cloud providers.
--- .../roles/codereadyrepo/defaults/main.yml | 5 +++ playbooks/roles/codereadyrepo/tasks/main.yml | 41 +++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 playbooks/roles/codereadyrepo/defaults/main.yml
playbooks/roles/codereadyrepo/defaults/main.yml new file +5 -0
@@ -0,0 +1,5 @@ +# SPDX-License-Identifier GPL-2.0+ +--- +# Our sensible defaults for the codereadyrepo role. + +kdevops_enable_terraform: false
playbooks/roles/codereadyrepo/tasks/main.yml +32 -9
46 lines not on this page · raw message
Signature · 1 line
2.47.0
Quoted 11 lines · On Tue, Dec 10, 2024 at 02:29:13PM -0500, [email protected] wrote:
From: Chuck Lever <[email protected]>
This series is a handful of loosely related patches that I wrote while trying to get kdevops operational on AWS again, for use with NFS workflows. Note that there are still one or two more issues that need to be tracked down before AWS will be working well for me.
These might also be useful for OCI or other cloud providers.
Please have a look. I'm happy to make changes or drop one or two of these if needed.
I'm not an NFS developer, but for the kdevops parts, this seems all sensible:
Luis