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

Re: Stable NVMe block device names on AWS Nitro instances



On Fri, 3 Apr 2020, at 22:56, Noah Meyerhans wrote:
> On Fri, Apr 03, 2020 at 06:16:33PM +0200, Jonathan Ballet wrote:
> > 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.

I found *references* to that package but not the original code nor
repository. Would you have a link to where this package is by any chance?

> > 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?

Our use case is to start brand new instances with a new set of dedicated
disks, and automatically partition, format and mount them using
cloud-init, more or less like this:

    disk_setup:
      /dev/nvme1n1:
        table_type: gpt
        layout: [ 100 ]
    fs_setup:
      - label: data
        filesystem: ext4
        device: /dev/nvme1n1
    mounts:
      - [ "/dev/nvme1n1p1", "/data" ]

In which case:

* The name of the device /dev/nvme1n1 has to be guessed from the
  "device_name" that is passed when creating the instance.

* The UUID is that case is not known, so we can't use it during the
  mount step.

* AFAIK, it would be possible to format the disk in advance, get the
  UUID of the partition, and pass it to cloud-init here.
  Although possible, this has 2 issues:

  - This is yet another level of indirection, where we'll need to
    remember that volume ID `vol-something` maps to UUID xxx.

  - This completely binds our configuration to that particular
    *partition* (The UUID would be in the cloud-init configuration.)
    This removes a bit of flexibility IMO.


> > 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.

Cool, so I'll see if I can come up with something and propose it for the
Debian AWS AMI :)

 Jonathan


Reply to: