[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Stable NVMe block device names on AWS Nitro instances



On Fri, Apr 03, 2020 at 06:16:33PM +0200, Jonathan Ballet wrote:
> On AWS Nitro instances, EBS volumes are exposed as NVMe block devices by
> the kernel on the /dev/nvme* paths.
> 
> The AWS documentation "Identifying the EBS Device" says that the Linux
> kernel doesn't guarantee the creation order of these devices, as they
> are discovered in the order the devices respond.
> 
> This creates a situation where you can start an instance with 2 (or
> more) attached EBS and sometimes end up with the "root" EBS being named
> /dev/nvme0n1 and the other one /dev/nvme1n1, sometimes the opposite.

This is why we use UUIDs exclusively in fstab.

> In its own Linux image, AWS apparently ships a set of udev rules + a
> script to get these device names out of the information exposed by the
> NVMe devices, which create appropriate symlinks in /dev towards each
> /dev/nvme* devices.

This is the ec2-utils package.  I haven't looked at how portable it is,
but the code is MIT and Apache 2.0 licensed, so we should be able to
incorporate it if needed.

> This doesn't change the random detection order by the kernel, but this
> provides a more stable interface to deal with instances containing
> multiple disks.

Is there any reason that you can use UUIDs and/or LVM to accomplish the
same thing?

> I wonder if it would be possible to provide such a mechanism by default
> in the official Debian AMI?
> Is this type of cloud provider-specific configuration could be accepted?
> (I guess that would make sense only for AWS images.)

The AMIs are provider-specific anyway, so this isn't an issue.

noah


Reply to: