Bug 1032218 - /dev/disk/by-path does not account for NPIV paths
Summary: /dev/disk/by-path does not account for NPIV paths
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: udev
Version: 6.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Harald Hoyer
QA Contact: Radka Skvarilova
Jana Heves
Depends On:
Blocks: 1270825 1266934
TreeView+ depends on / blocked
Reported: 2013-11-19 17:56 UTC by Dave Allan
Modified: 2016-05-11 00:26 UTC (History)
11 users (show)

Fixed In Version: udev-147-2.72.el6
Doc Type: Bug Fix
Doc Text:
`/dev/disk/by-path/` now accounts for NPIV paths Previously, if two or more virtual host bus adapters (HBAs) were created on a single physical HBA, only a single link to the device was created in the `/dev/disk/by-path/` directory instead of one link for each path. As a consequence, creating a *virsh* pool with virtual HBAs by using Fibre Channel N_Port ID Virtualization (NPIV) did not work correctly. With this update, symbolic links in `/dev/disk/by-path/` are created correctly and are unique. Symbolic links in `/dev/disk/by-path/` created by *udev* for logical unit numbers (LUNs) connected through a physical Fibre Channel N_Port stay the same.
Clone Of:
: 1266934 (view as bug list)
Last Closed: 2016-05-11 00:26:03 UTC

Attachments (Terms of Use)
ls of /dev/disk/by-path (976 bytes, text/plain)
2013-11-19 17:56 UTC, Dave Allan
no flags Details
output of cat /proc/scsi/scsi (1.26 KB, text/plain)
2013-11-19 17:56 UTC, Dave Allan
no flags Details
ls of /dev/disk/by-id (3.42 KB, text/plain)
2013-11-19 17:57 UTC, Dave Allan
no flags Details
output of virsh nodedev-list --tree (shows the device hierarchy) (3.79 KB, text/plain)
2013-11-19 17:58 UTC, Dave Allan
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0903 normal SHIPPED_LIVE udev bug fix update 2016-05-10 22:51:07 UTC

Description Dave Allan 2013-11-19 17:56:04 UTC
Created attachment 826223 [details]
ls of /dev/disk/by-path

Description of problem:
If I create two or more virtual host bus adapters on a single physical HBA, only one link gets created in /dev/disk/by-path

I believe this behavior is the result of by-path taking into account different PCI adapters and logical unit serial numbers, but not the scsi host number when creating the links.  Since the PCI BDF and the device serial numbers match, only one link gets created.


Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create multiple vHBAs on the same physical HBA and expose a target and LUN to the vHBAs


Actual results:
/dev/disk/by-path has only a single link to the device (see attached files)

Expected results:
/dev/disk/by-path has only a link per path to the device

Additional info:
This behavior requires an NPIV capable SAN to reproduce, so please let me know what information I can provide and I'll help in any way I can.

Comment 1 Dave Allan 2013-11-19 17:56:53 UTC
Created attachment 826224 [details]
output of cat /proc/scsi/scsi

Comment 2 Dave Allan 2013-11-19 17:57:25 UTC
Created attachment 826225 [details]
ls of /dev/disk/by-id

Comment 3 Dave Allan 2013-11-19 17:58:22 UTC
Created attachment 826226 [details]
output of virsh nodedev-list --tree (shows the device hierarchy)

Comment 4 Dave Allan 2013-11-19 18:00:39 UTC
I didn't quite finish the description before submitting the BZ:


shows the relationship between the block device and the SCSI device

Comment 6 RHEL Product and Program Management 2013-11-22 19:02:55 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 11 Maurizio Lombardi 2015-10-14 13:00:59 UTC
I'm working on it right now,

So the by-path format /dev/by-path/pci-xxx-fc-<port_name>-<lun> is ambiguous when there are multiple virtual HBAs on the same physical HBA (NPIV),

I'm not sure about how to properly fix this bug yet, we could add the scsi host number to by-path as Dave suggests or maybe the port_name of the virtual HBA?
I'll try to come up with a solution.

Comment 13 Michal Sekletar 2015-11-16 14:19:08 UTC
Maurizio, any progress with that patch for path_id?

Comment 14 Maurizio Lombardi 2015-11-16 15:36:03 UTC
Michal, see bz 1266934 comment 22

Comment 15 Michal Sekletar 2015-12-21 10:34:55 UTC
Maurizio, can you please post the patch upstream via GitHub pull request?

Comment 16 Maurizio Lombardi 2015-12-21 10:40:16 UTC
Michal, I will post it soon. Sorry for the delay but one customer reported some problems with the first version of the patch and I had to modify it.

They are going to test the new version right now, if they confirm the patch works then I proceed to send it upstream.

Comment 22 Michal Sekletar 2016-03-01 12:40:22 UTC
I've reverted current patch and merged patch proposed in https://github.com/systemd/systemd/pull/2731

Comment 25 errata-xmlrpc 2016-05-11 00:26:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.