NetApp / netappdvp

A Docker volume plugin for NetApp storage
96 stars 33 forks source link

"docker volume rm" destroys the volume in ONTAP #51

Closed jbalana closed 7 years ago

jbalana commented 7 years ago

Hello,

the current behaviour of the NetApp plugin for NAS is to destroy the ONTAP volume when you do a "docker volume rm". This can be dangerous if the volume gets removed form one host while other nodes might be using it.

When you use the "local" driver to create a regular volume, the volume and data is deleted when you delete the volume.

The behaviour is different when you use the "local" driver to create a NFS volume: docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir --name foo In this case the NFS volume is not destroyed (obviously) which is the source of my confusion.

Any comments? Could this be implemented as an option?

regards, Jaime

innergy commented 7 years ago

It could be a plugin option, and it's one we've discussed it before. However it would be an all or nothing thing that you specify when the plugin initializes, because the Docker's volume delete API doesn't allow you to specify options.

The way it behaves now (removing the volume) is the way most other volume plugins behave. The example you gave is kind of a special case, using the local driver to specify an NFS mount. If you were to create a regular local volume, add some data to it and then remove it, the data would be gone.

No plans to change this behavior right now, but thanks for the feedback!