-
Notifications
You must be signed in to change notification settings - Fork 30
[AWS EBS] NVMe udev rename rules #2399
Comments
Thanks for the report. We are already collecting a few cloud-storage specific udev rules, so I think we should also add the AWS NVMe ones there too. |
Until support is added to CoreOS, I've created a set of systemd services and a udev rule that works around the issue based on the resources I listed above: https://gist.github.com/jalaziz/bcfe2f71e3f7e8fe42a9c294c1e9279f |
I'm also having this issue with coreos alpha and stable. @jalaziz scripts do identify the intended partition. Would be great to have this fixed within coreos. It seems reasonable to assume the OS would respect the wishes of the user to have
|
You realize the repo you listed, https://github.com/oogali/ebs-automatic-nvme-mapping, has an MIT license, correct? I believe if anyone wishes to use it, the license must follow the code; like if you are merging it into your project. Or copying it as the case may be. |
Thanks for the note @nielssorensen. I overlooked that. I've updated my gist to include the appropriate copyright notices and licenses. |
Udev rules and helper landed in coreos/init#268. |
This has been released as part of CL 1828.0.0 (current alpha). |
r5.* have the same issue |
@lucab tested against 1883.0.0 with r5.* instances and it looks solved, although when i compare t2.* instances where the volumes get mapped to /dev/xvd* against r5.* where i get only /dev/sd*... which is again not consistent or am i missing something? |
@zyclonite you can look directly into |
@lucab true, but on one instance type the ebs device is exposed as nvme and on the other as xvd or sd... wouldn't it make more sense to map ebs devices so that the same names can be used with the same single container linux config independent of the instance type? |
The original workaround I proposed created symlinks for both variations |
I understand it is unfortunate and that the other script was blindly creating multiple device names, but that is not a correct thing to do in distribution vendor rules. Those device names don't really exist and in future may clash with other device naming choices by AWS. AWS documentation explicitly mentions that device names can differ wildly according to multiple parameters: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html |
If you feel reusing device names that could exist regularly (though thats unlikely the case on the same instance), why not create new, artificial names like /dev/clouddisk1 |
lucab's reference was useful. Until a better naming convention is implemented, here is what one might do to get around this. We use SLES, so: zypper install nvme-cli Simple script: #!/bin/bash nvme_map.bsh - Map nvme names to volume IDs####################################################### ./nvme_map.bshnvme2n1 vol0691209dc9ce0c7e4 Futher, a wrapper for lsblk can be created to provide the mapping directly: #!/usr/bin/perl lsblk.pl - show lsblk output combined with nvme mapping################################################################ open(LSBLK_IN, "$LSBLK |") || die "Cannot run "$LSBLK"\n";
close( LSBLK_IN ); Output: ./lsblk.plNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT VOLUME-ID |
I came up with a solid solution to how c5 instance types present devices out of order. I've had this in production for the last couple months just today had a chance to document it on my blog, have a look and see if this helps you: https://russell.ballestrini.net/aws-nvme-to-block-mapping/ |
Issue Report
Feature Request
Environment
AWS CoreOS 1688.5.3 HVM on m5.* or c5.* instances
Desired Feature
Add udev symlink rules to map NVMe devices to traditional xvd[a-z] device names.
Other Information
With the newer m5 and c5 instances, EBS volumes show up as NVMe devices. AWS Linux provides built-in udev rules that symlink the NVMe devices to their equivalent /dev/sd[a-z] naming. This keeps things consistent with the older naming rules and matches what is configured in EBS block device mappings provided when launching the instance.
It would be great if CoreOS could provide similar rules. This would allow systemd mounts to work across all EC2 instance types without special hacks or relying on fixed device names. AWS Linux handles this with the help of a python script named
ebsnvme-id
that read EBS information from the NVMe device. I realize python is not installed on CoreOS, but the script could be rewritten to provide the basic functionality needed for udev renaming.More information can be found here:
kubernetes-retired/kube-aws#1048
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html
An example udev rule without using the python script can be found here: https://github.com/oogali/ebs-automatic-nvme-mapping
I can't seem to find the python script publicly, but it's available on the Amazon Linux AMI and is licensed under the Apache 2.0 license. I've copied the current udev rules and scripts from the Amazon Linux AMI here: https://gist.github.com/jalaziz/c22c8464cb602bc2b8d0a339b013a9c4
One thing I've noticed (and has been mentioned elsewhere) is that the device name in the vendor-specific name is different depending on when and how the volume is mounted. For example, it seems that volumes mounted pre-boot do not have the
/dev/
prefix in the vendor info, while volumes mounted after have the/dev/
prefix. Also, it appears that the device is not renamed to thexvd
naming convention automatically.The text was updated successfully, but these errors were encountered: