Comment 14 for bug 1665143

Revision history for this message
Dan Streetman (ddstreet) wrote : Re: commissioning does not discover block devices on HP ProLiant DL360 Gen9 servers

> Checking that path [/dev/nvme0n1] and is same as link [nvme-nvme.8086-
> 43564d44343334353030424e34303041474e-494e54454c205353445045444d453430304734-00000001]

this is the wwid symlink, created by:
SYMLINK+="disk/by-id/nvme-$attr{wwid}"

> Checking that path [/dev/nvme0n1] and is same as link [nvme-
> INTEL_SSDPEDME400G4_CVMD434500BN400AGN]

this is the model/serial symlink, created by:
ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"

> This is the script that gathers the block devices. I looked into it and it seems that it is
> doing the right thing as it is getting the by-id link based on the /dev/nvme* path.

    def _path_to_idpath(path):
        """Searches dev_disk_byid for a device symlinked to /dev/[path]"""
        if os.path.exists(dev_disk_byid):
            for link in os.listdir(dev_disk_byid):
                if os.path.exists(path) and os.path.samefile(
                        os.path.join(dev_disk_byid, link), path):
                    return os.path.join(dev_disk_byid, link)
        return None

this just searches all the symlinks in /dev/disk/by-id/ and uses the first one that points to the target device or partition. That's fine if you don't actually care about which of the symlinks you use.

> The result is being rejected because the file path is currently to long for the field.

well the max path size needs to be increased then.