Closed ebalduf closed 7 years ago
We think the reason we weren't doing this for ontap isn't true anymore (too-frequent polling.) So maybe we can ditch that directory stuff entirely.
For reference, this logic is in the List function implementation: https://github.com/NetApp/netappdvp/blob/master/docker_driver.go#L343-L394
@ntap-rippy assuming you can hit the filer with a list command when someone calls a the list command from Docker, then the code that I proposed to fix this is #42 changes the way the list call is handled and calls the backend 'list' when docker 'list' is called. I had to modify the interface to the drivers, so all 3 drivers need to change. The code for ONTAP and E-Series is stubbed out as I don't have either to figure out and test the solution. The SolidFire code is all there.
Partial fix in e7e2db5
Fixed in f668241
The NDVP as it currently stands works great for a single docker node, but when you have multiple in a cluster, the fact that it uses the directory structure to determine if a volume exists is BAD since that directory structure only lives on a single node. Here is an example:
[ebalduf@d1 ~]$ docker volume create -d netapp --name=testcase1 testcase1 [ebalduf@d1 ~]$ docker run -ti --rm -v testcase1:/mnt/test ubuntu /bin/bash root@c036b35d3040:/# touch /mnt/test/thefile root@c036b35d3040:/# exit
[ebalduf@d2 ~]$ docker run -ti --rm -v testcase1:/mnt/test ubuntu /bin/bash root@ec513a5b14e6:/# ls /mnt/test root@ec513a5b14e6:/# exit [ebalduf@d2 ~]$ docker run -ti --rm --volume-driver netapp -v testcase1:/mnt/test ubuntu /bin/bash docker: Error response from daemon: create testcase1: conflict: volume name must be unique. See 'docker run --help'. [ebalduf@d2 ~]$ docker volume ls DRIVER VOLUME NAME local testcase1 [ebalduf@d2 ~]$ docker volume rm testcase1 testcase1 [ebalduf@d2 ~]$ docker run -ti --rm --volume-driver netapp -v testcase1:/mnt/test ubuntu /bin/bash root@0b441a2f7544:/# ls /mnt/test lost+found thefile root@0b441a2f7544:/# exit [ebalduf@d2 ~]$ docker volume ls DRIVER VOLUME NAME netapp testcase1 [ebalduf@d2 ~]$ docker volume rm testcase1 testcase1
[ebalduf@d1 ~]$ docker volume ls DRIVER VOLUME NAME netapp testcase1 [ebalduf@d1 ~]$ docker volume rm testcase1 Error response from daemon: Error while removing volume testcase1: remove testcase1: VolumeDriver.Remove: Problem removing docker volume: netappdvp-testcase1 error: Failed to retrieve volume named netappdvp-testcase1 during Remove operation; error: Failed to find any Volumes with Name: netappdvp-testcase1 for Account: 87 [ebalduf@d1 ~]$ docker volume ls DRIVER VOLUME NAME netapp testcase1