From c1601d347ceb3740e3f7b9f1a3e283b78200a358 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 20 Feb 2021 14:10:15 +0000 Subject: [PATCH] doc: add mount error on windows doc --- deploy/example/windows/README.md | 3 +++ deploy/example/windows/deployment.yaml | 1 + deploy/example/windows/statefulset.yaml | 1 + known-issues.md | 23 +++++++++++++++++++++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/deploy/example/windows/README.md b/deploy/example/windows/README.md index b2408b4680b..9cbf251f548 100644 --- a/deploy/example/windows/README.md +++ b/deploy/example/windows/README.md @@ -1,5 +1,8 @@ # CSI Driver on Windows +## Note +**Only** use root share for one SMB server in one cluster and use `subPath` in deployment, if there is already `\\smb-server\share\test1` mounted, would get error when mounting volume `\\smb-server\share\test2` after Windows node reboot. Workaround is only use `\\smb-server\share` as `source`. + ## Feature Status: Beta Refer to [Windows-CSI-Support](https://github.com/kubernetes/enhancements/tree/master/keps/sig-windows/1122-windows-csi-support) for more details. diff --git a/deploy/example/windows/deployment.yaml b/deploy/example/windows/deployment.yaml index a007221213d..aa9216c80a0 100644 --- a/deploy/example/windows/deployment.yaml +++ b/deploy/example/windows/deployment.yaml @@ -37,6 +37,7 @@ spec: volumeMounts: - name: smb mountPath: "/mnt/smb" + subPath: subPath volumes: - name: smb persistentVolumeClaim: diff --git a/deploy/example/windows/statefulset.yaml b/deploy/example/windows/statefulset.yaml index f381f1b1073..f52af87f1dd 100644 --- a/deploy/example/windows/statefulset.yaml +++ b/deploy/example/windows/statefulset.yaml @@ -25,6 +25,7 @@ spec: volumeMounts: - name: persistent-storage mountPath: /mnt/smb + subPath: subPath updateStrategy: type: RollingUpdate selector: diff --git a/known-issues.md b/known-issues.md index 53420ce4e65..a1c13cf75fd 100644 --- a/known-issues.md +++ b/known-issues.md @@ -1,9 +1,28 @@ ## Known issues -#### 1. mount error on Windows: `New-SmbGlobalMapping : A specified logon session does not exist` +#### 1. mount error on Windows + + - error details: ``` FailedMount: MountVolume.MountDevice failed for volume "pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a" : rpc error: code = Internal desc = volume(pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a) mount "\\\\40.64.101.43\\share" on "\\var\\lib\\kubelet\\plugins\\kubernetes.io\\csi\\pv\\pvc-2ca92cca-c690-4fea-842f-0a4d32e97f5a\\globalmount" failed with smb mapping failed with error: rpc error: code = Unknown desc = NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : A specified logon session does not exist. It may already have been terminated. \r\nAt line:1 char:190\r\n+ ... ser, $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+ ``` - - Fix + - Workaround To mount a SMB share on Windows, domain name should be provided in account, could use a dummy domain name, e.g. `Domain\AccountName` + +#### 2. mount error on Windows after reboot + + - error details: +``` +MountVolume.MountDevice failed for volume "pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4" : rpc error: code = Internal desc = volume(pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4) mount "//docp-smb1/smbservice" on "\var\lib\kubelet\plugins\kubernetes.io\csi\pv\pvc-1efb71f1-ab8a-4bbf-8db7-84a8e58877b4\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 +``` + + - Workaround + +**Only** use root share for one SMB server in one cluster and use `subPath` in deployment, if there is already `\\smb-server\share\test1` mounted, would get error when mounting volume `\\smb-server\share\test2` after Windows node reboot. Workaround is only use `\\smb-server\share` as `source`. + +I will add notion in the windows example doc, there is no fix for this issue currently. Thanks. + + - Mitigation if hit `Multiple connections to a server or shared resource by the same user` error + +log on to the Windows node, run `Get-SmbGlobalMapping` to list all mappings, run `Remove-SmbGlobalMapping -RemotePath xxx` to remove existing mapping, after a while, pod remount would succeed automatically \ No newline at end of file