5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-02-02 09:47:14 +03:00

fix #2460: use dm-uuid-mpath- as fallback for multipath

With Debian Buster it looks like the 'scsi-' method is no longer
reliable. In addition to that, which is also used for non-multipath
systems, add the 'dm-uuid-mpath-' method as fallback. This is also used
by openstack (see os-brick
39b201160b/os_brick/initiator/linuxscsi.py (L400))

Also sort the output of readdir so 'scsi-' is always after
'dm-uuid-mpath-' so the output of pvesm list does not change for systems
that worked before.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
Mira Limbeck 2020-07-07 16:14:54 +02:00 committed by Thomas Lamprecht
parent e6d1edcb93
commit 245b651789

View File

@ -151,11 +151,11 @@ sub load_stable_scsi_paths {
my $stabledir = "/dev/disk/by-id";
if (my $dh = IO::Dir->new($stabledir)) {
while (defined(my $tmp = $dh->read)) {
foreach my $tmp (sort $dh->read) {
# exclude filenames with part in name (same disk but partitions)
# use only filenames with scsi(with multipath i have the same device
# with dm-uuid-mpath , dm-name and scsi in name)
if($tmp !~ m/-part\d+$/ && $tmp =~ m/^scsi-/) {
if($tmp !~ m/-part\d+$/ && ($tmp =~ m/^scsi-/ || $tmp =~ m/^dm-uuid-mpath-/)) {
my $path = "$stabledir/$tmp";
my $bdevdest = readlink($path);
if ($bdevdest && $bdevdest =~ m|^../../([^/]+)|) {