OS brick does not have a check for all types of multipath device paths

Bug #1628163 reported by Sudipta Biswas
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
os-brick
Confirmed
Undecided
Sudipta Biswas

Bug Description

Per the docstring on the find_multipath_device_path method - there can be the following formats for multipath devices:

Multipath devices can show up in several places on
        a linux system.
        1) When multipath friendly names are ON:
            a device file will show up in
            /dev/disk/by-id/dm-uuid-mpath-<WWN>
            /dev/disk/by-id/dm-name-mpath<N>
            /dev/disk/by-id/scsi-mpath<N>
            /dev/mapper/mpath<N>
        2) When multipath friendly names are OFF:
            /dev/disk/by-id/dm-uuid-mpath-<WWN>
            /dev/disk/by-id/scsi-<WWN>
            /dev/mapper/<WWN>

However in the code: https://github.com/openstack/os-brick/blob/5dfa56d8f40799b95c9e6d18c8fc42c263b3f6c4/os_brick/initiator/linuxscsi.py#L241

We use only a couple of patterns amongst the 7 patterns listed.
On my host the multpath devices show up as scsi-* however, they go undetected by this code due to the missing pattern match.

This method should be enhanced to fix all device path types.

Changed in cinder:
assignee: nobody → Sudipta Biswas (sbiswas7)
affects: cinder → os-brick
Revision history for this message
swapnil-nilangekar (swapnil-nilangekar) wrote :

Hi,
I am using Ubuntu 16.04.2 system.
My setup has multipathd service in active state and there is no multipath.conf explicitly created in the system. Hence it is defaulting the 'user_friendly_name' to 'no'.

For initial mount/unmount operations for same volume through our FC driver /dev/disk/by-id/dm-uuid-mpath-<WWN> entry is populated.
Whereas after retrying few more number of times it is found that /dev/disk/by-id/dm-uuid-mpath-<WWN> entry is not populated. But it can be seen that /dev/disk/by-id/scsi-<WWN> path entry is available in all cases.

Ask here is to have path checks for all the possible multipath device path to avoid the failure of operation.

In short, for default multipath configuration on Ubuntu, sometimes /dev/disk/by-id/dm-uuid-mpath-<WWN>
and /dev/mapper/<WWN> path entries are not populated but /dev/disk/by-id/scsi-<WWN> entry is populated after the scan. Hence OS_brick needs to check entries for all the the possible paths.

Or Is there any other reason why path check is restricted to only /dev/disk/by-id/dm-uuid-mpath-<WWN>
and /dev/mapper/<WWN>.

Changed in os-brick:
status: New → Confirmed
Revision history for this message
Walt Boring (walter-boring) wrote :

First of all, we have to support more than just ubuntu. Second, the purpose of find_multipath_device_path() is to find a single path, not all paths and it has to work in the configuration of having friendly names off and on. So, the lowest common denominator was chosen for the path search algorithm.

We have to be distro agnostic. The paths that are searched now are the lowest common denominator in all the distros/platforms/architectures that os-brick supports. We don't know if friendly names are on or off, and can't find out without calling the multipath app, which is incredibly slow and unreliable. So, the algorithm that is in place now is the fastest and most reliable way to discover multipath devices on the system. The last resort, which is still in code, is to call multipath to discover the paths.

Also, we don't need to find the volume in every possible path it may show up. We just need to find one. Once one of those paths shows up, we can find the rest of them.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.