From 39fbd85d4eb78ed1ee3635e20621929b538d4c9c Mon Sep 17 00:00:00 2001 From: Noah Meyerhans Date: Fri, 11 Feb 2022 10:08:27 -0800 Subject: [PATCH 1/3] ci: install findutils as a dependency We use xargs from the findutils package, which is no longer installed by default in the AL 2022 container images. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83a9e0a..5128a2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: - run: name: "Install dependencies" command: | - dnf -y install python3-pip git + dnf -y install python3-pip git findutils pip install flake8 - checkout - run: From 0be3d3b5e020eaac436e4f62140a6fca6ad0003c Mon Sep 17 00:00:00 2001 From: Noah Meyerhans Date: Fri, 11 Feb 2022 10:00:00 -0800 Subject: [PATCH 2/3] bugfix: don't lose block-device-mapping symlinks for nvme devices Fixes https://github.com/aws/amazon-ec2-utils/issues/22 Symlinks need to be created on both add and change udev events, otherwise they're lost any time a change event is opened, e.g. when a device is open in read/write mode, e.g. when creating or mounting a filesystem. --- 70-ec2-nvme-devices.rules | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/70-ec2-nvme-devices.rules b/70-ec2-nvme-devices.rules index 22bed40..6fae458 100644 --- a/70-ec2-nvme-devices.rules +++ b/70-ec2-nvme-devices.rules @@ -4,19 +4,23 @@ # for the specific language governing permissions and limitations under # the License. +ACTION=="remove", GOTO="ec2_nvme_devices_end" + #nvme-ns-* devices -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ATTRS{model}=="?*", SYMLINK+="disk/by-id/nvme-$attr{model}_$attr{serial}-ns-%n", OPTIONS+="string_escape=replace" +KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ATTRS{model}=="?*", SYMLINK+="disk/by-id/nvme-$attr{model}_$attr{serial}-ns-%n", OPTIONS+="string_escape=replace" #nvme partitions -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ATTRS{model}=="?*", IMPORT{program}="/usr/sbin/ec2nvme-nsid %k" -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ATTRS{model}=="?*", ENV{_NS_ID}=="?*", SYMLINK+="disk/by-id/nvme-$attr{model}_$attr{serial}-ns-$env{_NS_ID}-part%n", OPTIONS+="string_escape=replace" +KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ATTRS{model}=="?*", IMPORT{program}="/usr/sbin/ec2nvme-nsid %k" +KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ATTRS{model}=="?*", ENV{_NS_ID}=="?*", SYMLINK+="disk/by-id/nvme-$attr{model}_$attr{serial}-ns-$env{_NS_ID}-part%n", OPTIONS+="string_escape=replace" # ebs nvme devices -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/usr/sbin/ebsnvme-id -u /dev/%k", SYMLINK+="%c" -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/usr/sbin/ebsnvme-id -u /dev/%k", SYMLINK+="%c%n" +KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/usr/sbin/ebsnvme-id -u /dev/%k", SYMLINK+="%c" +KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ENV{DEVTYPE}=="partition", ATTRS{model}=="Amazon Elastic Block Store", PROGRAM="/usr/sbin/ebsnvme-id -u /dev/%k", SYMLINK+="%c%n" # Do not timeout I/O operations on EBS volumes. -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", ATTR{queue/io_timeout}="4294967295" +KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon Elastic Block Store", ATTR{queue/io_timeout}="4294967295" # instance store nvme devices -ACTION=="add", KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon EC2 NVMe Instance Storage", ATTR{queue/io_timeout}="90000" +KERNEL=="nvme[0-9]*n[0-9]*", ENV{DEVTYPE}=="disk", ATTRS{model}=="Amazon EC2 NVMe Instance Storage", ATTR{queue/io_timeout}="90000" + +LABEL="ec2_nvme_devices_end" From 03acfbdd04e557c2655d9f57b46f03647f4edf86 Mon Sep 17 00:00:00 2001 From: Noah Meyerhans Date: Fri, 11 Feb 2022 10:02:31 -0800 Subject: [PATCH 3/3] rpm: update spec for 2.0.1-1 release --- amazon-ec2-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amazon-ec2-utils.spec b/amazon-ec2-utils.spec index 0b57e62..f52eda6 100644 --- a/amazon-ec2-utils.spec +++ b/amazon-ec2-utils.spec @@ -1,6 +1,6 @@ Name: amazon-ec2-utils Summary: A set of tools for running in EC2 -Version: 2.0 +Version: 2.0.1 Release: 1%{?dist} License: MIT Group: System Tools @@ -76,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Feb 11 2022 Noah Meyerhans 2.0.1-1 +- Don't lose NVME symlinks on udev change events + * Thu Jan 20 2022 Noah Meyerhans 2.0-1 - Update to 2.0 - Update python dependencies to python3