[dm-devel] Where to read the WWID of a multipath device

Russell Weber rustyscottweber at gmail.com
Thu Mar 21 07:57:39 UTC 2019


I would assume that most linux distributions at this point in time support
getting the wwids through:
```cat /etc/multipath/wwids````
This can also be parsed out of multipath -ll
```
[USER ~]# multipath -ll
mpathak (26639613661623365) dm-3 FUSIONIO,ION LUN
size=2.7T features='3 queue_if_no_path pg_init_retries 50' hwhandler='1
alua' wp=rw
|-+- policy='queue-length 0' prio=50 status=active
| |- 7:0:0:1  sdb 8:16 active ready running
| `- 8:0:0:1  sdc 8:32 active ready running
`-+- policy='queue-length 0' prio=1 status=enabled
  |- 9:0:0:1  sdd 8:48 active ready running
  `- 10:0:0:1 sde 8:64 active ready running
[USER ~]# cat /etc/multipath/wwids | grep -i 26639613661623365
/26639613661623365/
```
However, I'm curious as to why you would need the wwid as most higher level
python management libraries I've worked with are much more concerned with
the disk or partition GUID,  LUN number, or some other ID for the disk.
Example:
```
[USER by-uuid]# ls -al
total 0
drwxr-xr-x. 2 root root 120 Mar 20 14:58 .
drwxr-xr-x. 5 root root 100 Mar 20 14:58 ..
lrwxrwxrwx. 1 root root  10 Mar 21 00:04
5b1c21dc-6f65-4d88-99a0-b30f76d08931 -> ../../dm-2
lrwxrwxrwx. 1 root root  10 Mar 21 00:04
72e5d3ab-d4b2-4d0a-8b77-ba9dd718871c -> ../../sda1
lrwxrwxrwx. 1 root root  10 Mar 21 00:04
df4b2a63-4a56-4173-ba82-45f567d1b5bf -> ../../dm-0
lrwxrwxrwx. 1 root root  10 Mar 21 00:04
fa3c2abb-d8d2-4a99-84d2-09f8204e429e -> ../../dm-1
[USER by-uuid]# pwd
/dev/disk/by-uuid

```
What do you need the WWID for as the multipath wwid may not be the best
option for the application you are looking at?

On Wed, Mar 20, 2019 at 4:28 AM Sahid Orentino Ferdjaoui <
sahid.ferdjaoui at canonical.com> wrote:

> Hi,
>
> The question is as indicated on title, what would be the best way to
> get the WWID of a multipath device, something which would work on any
> systems or storages.
>
> My idea was to read /sys/block/dm-X/name but someone indicated to me
> that may not be correct in some situation, like it seems that
> /lib/udev/scsi_id would not be correct either.
>
> To give a bit of context it's for an OpenStack library in Python.
>
> Thanks,
> s.
>
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20190321/2d7816be/attachment.htm>


More information about the dm-devel mailing list