Context
It may be necessary to create a UDEV rule to make the nvme device names persistent across reboots. The method below should would on RHEL/Centos 7 and RHEL/Centos 8 environments.Method
1) Get the ID_SERIAL_SHORT of nvme device:$ udevadm info --query=all --path=/block/nvme1n1 | grep ID_SERIAL_SHORT E: ID_SERIAL_SHORT=XXXXXXXXXXX
2) Create udev rule file :
cd /etc/udev/rules.d/
and create a file with appropriate name for the udev:
sudo vi 99-persistentnames.rules
and add the following for "DEVNAME1" device:
KERNEL=="nvme*[0-9]n*[0-9]", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL_SHORT}=="XXXXXXXXXXX", SYMLINK+="DEVNAME1"
3) Reload and run udev rules:
$ sudo /sbin/udevadm control --reload-rules $ sudo /sbin/udevadm trigger --type=devices --action=change