To avoid issues with the scsi_id command getting stuck and blocking the
attachment we use sysfs to search for the WWN, but it can happen that we
fail to detect the WWN even if it's present in sysfs.
This happens when the storage array has multiple designators and the
multipath daemon detects the multipaths very fast.
The flow is:
- os-brick attaches volumes using iscsiadm --login
- udev generates the symlink with the WWN (this is the one we want)
- multipathd detects the volumes and forms the DM
- udev replaces the previous symlink to point to the multipath DM
- os-brick checks the symlink
This patch adds code to get_sysfs_wwn that checks the individual devices
belonging to a multipath DM if the symlink points to a DM.
Closes-Bug: #1881608
Change-Id: I05f94d31277efec28ad50ae2f3502ab6fccfe37c
(cherry picked from commit 7fb37c2000)
(cherry picked from commit 935daead18)