Skip to content

second mount on same smb server address would fail on Windows #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andyzhangx opened this issue Jun 24, 2020 · 5 comments
Closed

second mount on same smb server address would fail on Windows #38

andyzhangx opened this issue Jun 24, 2020 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@andyzhangx
Copy link
Member

andyzhangx commented Jun 24, 2020

What happened:
Create two PVs referencing same smb server address, and mount those two PVs on the same node, the second mount would fail like following:

Events:
  Type     Reason       Age                    From                 Message
  ----     ------       ----                   ----                 -------
  Normal   Scheduled    16m                    default-scheduler    Successfully assigned default/busybox-smb-6dc9949fdf-mh6t9 to 1520k8s001
  Warning  FailedMount  5m25s (x2 over 9m56s)  kubelet, 1520k8s001  Unable to attach or mount volumes: unmounted volumes=[smb], unattached volumes=[default-token-zmz89 smb]: timed out waiting for the condition
  Warning  FailedMount  54s (x5 over 14m)      kubelet, 1520k8s001  Unable to attach or mount volumes: unmounted volumes=[smb], unattached volumes=[smb default-token-zmz89]: timed out waiting for the condition
  Warning  FailedMount  24s (x15 over 16m)     kubelet, 1520k8s001  MountVolume.MountDevice failed for volume "pv-smb" : rpc error: code = Internal desc = volume(abc-volumeid) mount "//f60068b32f4414710baa1f7.file.core.windows.net/pvc-7e46303a-5987-48d6-9f9c-34af9609dbdf" on "\\var\\lib\\kubelet\\plugins\\kubernetes.io\\csi\\pv\\pv-smb\\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : Multiple connections to a server or shared resource by the same user, using more than one user \r\nname, are not allowed. Disconnect all previous connections to the server or shared resource and try again. \r\nAt line:1 char:190\r\n+ ... ser, $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n   pping], CimException\r\n    + FullyQualifiedErrorId : Windows System Error 1219,New-SmbGlobalMapping\r\n \r\n", err: exit status 1

Windows server don't allow two New-SmbGlobalMapping mount with same remote-path:
https://github.com/kubernetes-csi/csi-driver-smb/blob/master/pkg/smb/smb_common_windows.go#L34

What you expected to happen:
Second mount should succeed even there is already a mount on the node.

related workaround fix in k8s v1.14.8: https://github.com/kubernetes/kubernetes/blob/211047e9a1922595eaa3a1127ed365e9299a6c23/pkg/util/mount/mount_windows.go#L94-L105

How to reproduce it:

Anything else we need to know?:

Environment:

  • CSI Driver version:
  • Kubernetes version (use kubectl version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@andyzhangx andyzhangx added the kind/bug Categorizes issue or PR as related to a bug. label Jun 24, 2020
@andyzhangx andyzhangx changed the title second mount on same smb server address would fail second mount on same smb server address would fail on Windows Jun 27, 2020
@andyzhangx
Copy link
Member Author

should not an issue now

@andyzhangx
Copy link
Member Author

works well with 5 replicas running on 2 nodes:

azureuser@k8s-master-34601416-0:~$ k get po -o wide
NAME                                  READY   STATUS              RESTARTS   AGE     IP            NODE                    NOMINATED NODE   READINESS GATES
busybox-smb-6dc9949fdf-4gsrz          1/1     Running             0          12s     10.240.0.51   3460k8s000              <none>           <none>
busybox-smb-6dc9949fdf-kp9zw          1/1     Running             0          69s     10.240.0.38   3460k8s000              <none>           <none>
busybox-smb-6dc9949fdf-mwvpz          1/1     Running             0          2m58s   10.240.0.60   3460k8s000              <none>           <none>
busybox-smb-6dc9949fdf-s8qn9          1/1     Running             0          100s    10.240.0.16   3460k8s001              <none>           <none>
busybox-smb-6dc9949fdf-tcsfd          1/1     Running             0          69s     10.240.0.11   3460k8s001              <none>           <none>

@SomKen
Copy link

SomKen commented Dec 24, 2020

Pro tip: WHAT DID YOU DO!? You need to say what you fixed...

@SachinL9
Copy link

SachinL9 commented Feb 3, 2021

Can you please specify which version to upgrade to get this fix?

@andyzhangx andyzhangx reopened this Feb 3, 2021
@andyzhangx
Copy link
Member Author

andyzhangx commented Feb 17, 2021

second mount on same smb server would not fail on Windows now with csi-proxy v0.2.2, while there is another issue due to windows node reboot: #219 (comment), close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants