Comment 5 for bug 1830913

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1830913] Re: Create by-dname symlinks based on NVMe namespace UUIDs instead of controller serial numbers

On Thu, May 30, 2019 at 7:50 AM Dmitrii Shcherbakov <
<email address hidden>> wrote:

> Ryan,
>
> Got the needed output, it looks like the namespace block device created
> on a virtual NVMe subsystem has ID_SERIAL and ID_SERIAL_SHORT referring
> to a particular controller:
>
> $ readlink /sys/block/nvme0*
> ../devices/pci0000:80/0000:80:01.0/0000:81:00.0/nvme/nvme0/nvme0c33n1
> ../devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
> ubuntu@node-7:~$ udevadm info -q all -n /dev/nvme0n1
> P: /devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
> N: nvme0n1
> S: disk/by-dname/nvme0n1
> S: disk/by-id/nvme-Dell_Express_Flash_PM1725b_1.6TB_AIC_S47ANE0M300982
> S: disk/by-id/nvme-eui.343741304d3009820025384500000004
> E:
> DEVLINKS=/dev/disk/by-id/nvme-Dell_Express_Flash_PM1725b_1.6TB_AIC_S47ANE0M300982
> /dev/disk/by-dname/nvme0n1
> /dev/disk/by-id/nvme-eui.343741304d3009820025384500000004
> E: DEVNAME=/dev/nvme0n1
> E: DEVPATH=/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
> E: DEVTYPE=disk
> E: ID_MODEL=Dell Express Flash PM1725b 1.6TB AIC
> E: ID_SERIAL=Dell Express Flash PM1725b 1.6TB AIC_S47ANE0M300982
> E: ID_SERIAL_SHORT=S47ANE0M300982
> E: ID_WWN=eui.343741304d3009820025384500000004
> E: MAJOR=259
> E: MINOR=1
> E: SUBSYSTEM=block
> E: TAGS=:systemd:
> E: USEC_INITIALIZED=8800965
>
>
> I don't have an NVMeOF setup to verify this but from what I understand a
> namespace can be discovered via one of multiple controllers and, therefore,
> may get different a ID_SERIAL or ID_SERIAL_SHORT content in a uevent. So
> there is a chance that the by-dname udev rule will be affected by the order
> of discovery of namespaces (i.e. a symlink will only be created if a
> namespace is discovered through the same controller that was used during
> commissioning).
>
> If we matched only against ID_WWN then we would not care about the
> controller through which a namespace has been discovered.
>

So, in a NVME *fabric*, separate machines which have different controller
serial numbers (ID_SERIAL, ID_SERIAL_SHORT) may point to the same WWN,
IIUC. I believe that the controller is going to be the *same* on the
commissioned node as when it is deployed. So I still think these rules
will be fine.

>
> > OK. I would be surprised if the udev info contained hidden values
>
> What I meant was that both of the namespace-related entries are present
> in sysfs:
>
> /sys/block/nvme0c33n1
> /sys/block/nvme0n1
>
> But only one entry is present in devtmpfs because GENHD_FL_HIDDEN flag
> is applied to a controller-specific gendisk in the kernel:
>
> /dev/nvme0n1
>

Yes, I get that; What I'm saying is that I would consider it a udev/kernel
bug if nvme0c33n1 were to ever show up in a value in the udev database,
specifically because nvme0c33n1 is *not* a block device (it's
hidden/ignored).

>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1830913
>
> Title:
> Create by-dname symlinks based on NVMe namespace UUIDs instead of
> controller serial numbers
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1830913/+subscriptions
>