public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] fix #2460: use dm-uuid-mpath- as fallback for multipath
@ 2020-07-07 14:14 Mira Limbeck
  2020-07-07 15:02 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Mira Limbeck @ 2020-07-07 14:14 UTC (permalink / raw)
  To: pve-devel

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
https://github.com/openstack/os-brick/blob/39b201160bbff39117fca46b2709ff3f74c53d80/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>
---
 PVE/Storage/ISCSIPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm
index d5cb733..f2694ba 100644
--- a/PVE/Storage/ISCSIPlugin.pm
+++ b/PVE/Storage/ISCSIPlugin.pm
@@ -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|^../../([^/]+)|) {
-- 
2.20.1





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

* [pve-devel] applied: Re: [PATCH storage] fix #2460: use dm-uuid-mpath- as fallback for multipath
  2020-07-07 14:14 [pve-devel] [PATCH storage] fix #2460: use dm-uuid-mpath- as fallback for multipath Mira Limbeck
@ 2020-07-07 15:02 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-07-07 15:02 UTC (permalink / raw)
  To: Proxmox VE development discussion, Mira Limbeck

On 07.07.20 16:14, Mira Limbeck wrote:
> 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
> https://github.com/openstack/os-brick/blob/39b201160bbff39117fca46b2709ff3f74c53d80/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>
> ---
>  PVE/Storage/ISCSIPlugin.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
>

applied, thanks!




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

end of thread, other threads:[~2020-07-07 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 14:14 [pve-devel] [PATCH storage] fix #2460: use dm-uuid-mpath- as fallback for multipath Mira Limbeck
2020-07-07 15:02 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal