-
Notifications
You must be signed in to change notification settings - Fork 95
[Windows Plugin] Failed to mount volume with short name when it is already mounted with long name previously #2006
Comments
@govint Can you please take a look at this issue? |
Hit the same issue when I write a message from host1 to a file on the volume and try to read the content from host2 from same file on the volume.
|
It is not reproducible and not an issue. I have executed following steps and am confirming that the scenario is working as expected (let's ignore the comment #2006 (comment)) testbed setup: 2 windows VM registered to one ESX steps
|
if the volume is mounted with short name subsequent mount request with short volume is not having issue and vice versa for the long volume name. The reported issue is observed when the volume is mounted with short name and the next mout request comes with long volume name. one question I have here is: what happens when there is two volume present with the same name created on the different datastore?
@govint can you please help for the workflow mentioned at #2006 (comment)? |
Discussed with @govint offline and updating the thread here. Answer: If there are volumes with the same name on different DS then the long name has to be given, it is a known issue and we need to document this one. (Thanks @govint for the explanation) @ashahi1 we need to document this one, can you please add this information to your ongoing PR. |
Root cause is fs_windows.go:GetMountInfo() is parsing the result of "Get-Partition" (powershell) and parses the result and seems to end up stripping all of the returned mounted partitions. When the next mount request of the same volume comes, the code misses the fact that the volume is already mounted and tries to mount again (always uses the @ format to mount) and gets a mount error. The failed mount results in the volume getting detached. Meaning,. the container thats already using the volume just lost its access to the volume and data. Will post the fix tomorrow for review. |
Another issue is how windows passes the volume name to docker and hence the plugin. The datastore name gets converted to lower case and so the plugin doesn't realize the volume is already mounted and tries mounting again. For example, First we mount a volume "mvol2" and then try to mount it again, then we try to mount it with the datastore name attached, |
Looks like the approach used in #1712 wasn't quiet complete, case insensitive checks in the ESX service is one thing, the plugin can fail within itself even before reaching the ESX service. This issue is one example. The refcnt module is unable to recognize the volume name with lowercase datastore name and allows a duplicate mount to get thru. |
CC'ing Shaomin here. /CC @shaominchen |
Failed to mount volume with short name when it is already mounted with long name previously and vice versa.
Test Name: TestLongVolumeName
https://github.com/vmware/docker-volume-vsphere/blob/ee3ef339cb0703492e6d02f96fb4cb8a242065a1/tests/e2e/restart_test.go
Steps:
C:\Program Files\Docker\docker.exe: Error response from daemon: error while mounting volume 'C:\Windows\system32\config\systempr ofile\AppData\Local\docker-volume-vsphere\mounts\test1234@sharedvmfs-0\': VolumeDriver.Mount: Add-PartitionAccessPath : The requ ested access path is already in use.
===========
Detailed steps and their output are as follows:
Logs:
vmdk_ops.txt
docker-volume-vsphere.txt
The text was updated successfully, but these errors were encountered: