From 7fcd68b340a1f0af5802e1c64a7acd96b8c18cd3 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Wed, 11 Jul 2018 15:02:14 +0300 Subject: [PATCH] Windows SMBFS: avoid mounting local shares by default In quite a few situations, SMB shares exposed by the local server cannot be mounted locally (e.g. SoFS shares). The Nova Hyper-V driver will always pass the 'local_path_for_loopback' flag to the os-brick connector, but this doesn't happen when Cinder connects to volumes exposed by the SMB driver. For this reason, cinder will fail to backup volumes residing on SoFS shares. To keep it simple, we can just change the default behavior of the SMB os-brick connector so that local shares are never mounted, using the shared path directly. Change-Id: Id5beadce70532fb6b0e56e40fce1f62e6eaa3877 Related-Bug: #1781205 --- os_brick/initiator/windows/smbfs.py | 2 +- os_brick/remotefs/windows_remotefs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os_brick/initiator/windows/smbfs.py b/os_brick/initiator/windows/smbfs.py index 9609de600..e530be747 100644 --- a/os_brick/initiator/windows/smbfs.py +++ b/os_brick/initiator/windows/smbfs.py @@ -31,7 +31,7 @@ class WindowsSMBFSConnector(win_conn_base.BaseWindowsConnector): # shares. This is in fact mandatory in some cases, for example # for the Hyper-C scenario. self._local_path_for_loopback = kwargs.get('local_path_for_loopback', - False) + True) self._expect_raw_disk = kwargs.get('expect_raw_disk', False) self._remotefsclient = remotefs.WindowsRemoteFsClient( diff --git a/os_brick/remotefs/windows_remotefs.py b/os_brick/remotefs/windows_remotefs.py index 598efd8cf..7e48a8250 100644 --- a/os_brick/remotefs/windows_remotefs.py +++ b/os_brick/remotefs/windows_remotefs.py @@ -42,7 +42,7 @@ class WindowsRemoteFsClient(remotefs.RemoteFsClient): } self._local_path_for_loopback = kwargs.get('local_path_for_loopback', - False) + True) if mount_type not in mount_type_to_option_prefix: raise exception.ProtocolNotSupported(protocol=mount_type)