Other Are persistent device files for FC LUs possible without using labels?

FreeBSD Friends,

I'm using 12.1-RELEASE-p6 with an ocs_fc(4) Emulex LPe31002 HBA. This HBA sees two LUs from a Hitachi VSP G900 storage array. Each LU's visible across a single path.

After booting with kern.geom.label.disk_ident.enable="1" in /boot/loader.conf, a device file appears in /dev/diskid for one of the two LUs, but not both.

The file's /dev/diskid/DISK-50415022. The 50415022 part corresponds to this array's serial number.

The trouble's that the LUs from the array both have the same serial number, which seems typical of FC storage array LUs.
Code:
# dmesg | grep 415022
da4: Serial Number 50415022
da5: Serial Number 50415022

Meanwhile, FreeBSD does detect LU WWID/WWN values, and reports them in a "lunid" field; here's one of them:
Code:
# geom disk list da4
Geom name: da4
Providers:
1. Name: da4
   Mediasize: 53477376 (51M)
   Sectorsize: 512
   Mode: r0w0e0
   descr: HITACHI OPEN-V-CM
   lunname: HITACHI 50403AAE0248
   lunid: 60060e80123aae0050403aae00000248
   ident: 50415022
   rotationrate: unknown
   fwsectors: 32
   fwheads: 64

What I'd really like would be something like /dev/lunid/60060e80123aae0050403aae00000248.

The various label-based approaches won't work, because I cannot write labels to the LUs. These LUs are "command devices" made for in-band array management, and writing anything to them other than proprietary array management stuff's a no-no. I'll be mapping these LUs to a bhyve guest for which Hitachi management software exists.

Does anybody know of a way to achieve persistent (non-attachment based) device files for these LUs?

Thank you!
 
As you correctly point out, the sensible way to do this is via the WWN or LU ID. Those are pretty much guaranteed to be world-wide unique for every LU (*). And it is pretty obvious that using the device's manufacturer/serial number/revision is not going to be unique when using multiple LUs on the same device.

(* Footnote: Unless you are using prototype hardware, where the WWN of all devices is zero, which causes lots of hilarity.)

I don't know how to do this with zero effort. As far as I know, FreeBSD has no way to create dev entries by WWN. But you could pretty easily fake it: Run a little script that goes over all the /dev/daX entries, runs something like "camcontrol inquiry" or "geom disk list" over them, parses the output, and hand-creates soft-links to the correct devices. If you are worried about the devices being attached and detached, connect the script to devd.
 
Back
Top