All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] udev ID_UID attribute ???
@ 2016-07-07 21:21 Xose Vazquez Perez
  2016-07-08 15:52 ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: Xose Vazquez Perez @ 2016-07-07 21:21 UTC (permalink / raw)
  To: device-mapper development, Hannes Reinecke, Benjamin Marzinski,
	Christophe Varoqui

Is "ID_UID" really valid?

libmultipath/hwtable.c:         .uid_attribute = "ID_UID",


Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Question] udev ID_UID attribute ???
  2016-07-07 21:21 [Question] udev ID_UID attribute ??? Xose Vazquez Perez
@ 2016-07-08 15:52 ` Mike Christie
  2016-07-08 20:45   ` Xose Vazquez Perez
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Christie @ 2016-07-08 15:52 UTC (permalink / raw)
  To: Xose Vazquez Perez, device-mapper development, Hannes Reinecke,
	Benjamin Marzinski, Christophe Varoqui

On 07/07/2016 04:21 PM, Xose Vazquez Perez wrote:
> Is "ID_UID" really valid?
> 
> libmultipath/hwtable.c:         .uid_attribute = "ID_UID",
> 

I was wondering the same thing. For ceph rbd, we do not have the normal
scsi serial/wwn values, so I am modifying our udev rule to export ID_UID.

I made the ID_UID, the values we use for the udev (/dev/rbd) name which
is the pool name (basically just a grouping of storage) plus the image
name (basically name of a disk created in a pool).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Question] udev ID_UID attribute ???
  2016-07-08 15:52 ` Mike Christie
@ 2016-07-08 20:45   ` Xose Vazquez Perez
  2016-07-11  6:40     ` Hannes Reinecke
  0 siblings, 1 reply; 4+ messages in thread
From: Xose Vazquez Perez @ 2016-07-08 20:45 UTC (permalink / raw)
  To: Mike Christie, device-mapper development, Hannes Reinecke,
	Benjamin Marzinski, Christophe Varoqui

On 07/08/2016 05:52 PM, Mike Christie wrote:

> On 07/07/2016 04:21 PM, Xose Vazquez Perez wrote:
>> Is "ID_UID" really valid?
>>
>> libmultipath/hwtable.c:         .uid_attribute = "ID_UID",
>>
> 
> I was wondering the same thing. For ceph rbd, we do not have the normal
> scsi serial/wwn values, so I am modifying our udev rule to export ID_UID.
> 
> I made the ID_UID, the values we use for the udev (/dev/rbd) name which
> is the pool name (basically just a grouping of storage) plus the image
> name (basically name of a disk created in a pool).

ID_UID isn't "standard". It wasn't found in kernel, multipath-tools or systemd(udev)
sources.

It's variable returned by dasdinfo from 390-tools package, it contains the "DASD uid"
of a dasd device. And it's used by udev rules to make symlinks for dasd devices under
/dev/disk/by-id/

This is hercules, but in a LPAR shows a similar output:
sles11-s390x:~ # dasdinfo -e -a -d /dev/dasda
ID_BUS=ccw
ID_TYPE=disk
ID_UID=HRC.ZZ000000000001.0120.22
ID_XUID=HRC.ZZ000000000001.0120.22
ID_SERIAL=0X0122

sles11-s390x:~ # grep ID_UID  /etc/udev/rules.d/59-dasd.rules
KERNEL=="dasd*[!0-9]", ENV{ID_UID}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_UID}"
KERNEL=="dasd*[0-9]", ENV{ID_UID}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_UID}-part%n"


It was used for dasd devices in multipath-tools because they haven't a WWN.

So, invent another undocumented variable name :-) , "ID_CEPH" or "ID_CEPH-RBD" ...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Question] udev ID_UID attribute ???
  2016-07-08 20:45   ` Xose Vazquez Perez
@ 2016-07-11  6:40     ` Hannes Reinecke
  0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2016-07-11  6:40 UTC (permalink / raw)
  To: Xose Vazquez Perez, Mike Christie, device-mapper development,
	Benjamin Marzinski, Christophe Varoqui

On 07/08/2016 10:45 PM, Xose Vazquez Perez wrote:
> On 07/08/2016 05:52 PM, Mike Christie wrote:
> 
>> On 07/07/2016 04:21 PM, Xose Vazquez Perez wrote:
>>> Is "ID_UID" really valid?
>>>
>>> libmultipath/hwtable.c:         .uid_attribute = "ID_UID",
>>>
>>
>> I was wondering the same thing. For ceph rbd, we do not have the normal
>> scsi serial/wwn values, so I am modifying our udev rule to export ID_UID.
>>
>> I made the ID_UID, the values we use for the udev (/dev/rbd) name which
>> is the pool name (basically just a grouping of storage) plus the image
>> name (basically name of a disk created in a pool).
> 
> ID_UID isn't "standard". It wasn't found in kernel, multipath-tools or systemd(udev)
> sources.
> 
> It's variable returned by dasdinfo from 390-tools package, it contains the "DASD uid"
> of a dasd device. And it's used by udev rules to make symlinks for dasd devices under
> /dev/disk/by-id/
> 
> This is hercules, but in a LPAR shows a similar output:
> sles11-s390x:~ # dasdinfo -e -a -d /dev/dasda
> ID_BUS=ccw
> ID_TYPE=disk
> ID_UID=HRC.ZZ000000000001.0120.22
> ID_XUID=HRC.ZZ000000000001.0120.22
> ID_SERIAL=0X0122
> 
> sles11-s390x:~ # grep ID_UID  /etc/udev/rules.d/59-dasd.rules
> KERNEL=="dasd*[!0-9]", ENV{ID_UID}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_UID}"
> KERNEL=="dasd*[0-9]", ENV{ID_UID}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_UID}-part%n"
> 
Primary reason here is that DASDs already had an ID_SERIAL, which
happens to contain the disk number. Which unfortunately is _not_ unique,
but rather per guest. So we had to come up with a different identifier
here to get persistent _and_ unique WWIDs.

(And there also the thingie with IBMs GDPRS, which requires us to have
completely different WWIDs, too. But let's not be sidetracked here).

> 
> It was used for dasd devices in multipath-tools because they haven't a WWN.
> 
Well... As mentioned above, they have one _now_ (that's the
ID_UID/ID_XUID above). But by the time we've been doing the persistent
names they didn't.

I would rather make sure Ceph/RBD has a sysfs attribute somewhere which
contains a unique number.
And then we could code a similar thing like we did for SCSI with the
vpd83 access to get the WWID.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-11  6:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 21:21 [Question] udev ID_UID attribute ??? Xose Vazquez Perez
2016-07-08 15:52 ` Mike Christie
2016-07-08 20:45   ` Xose Vazquez Perez
2016-07-11  6:40     ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.