[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Does NFS PVC wipe existing data before attaching?



You should be able to set pvc.spec.volumeName to the name of the volume you want to bind.

On Thu, Oct 13, 2016 at 10:59 PM, Lionel Orellana <lionelve gmail com> wrote:
In my limited experimentation I had problems with NFS PVs getting wiped out even though the policy was set to Retain. In fact I ended up in this situation where if I created a file in the NFS volume it was deleted in front of my eyes in a few seconds. Obviously I did something very wrong with the PV.  I've found mounting the NFS volume directly into the pod as Seth suggested a lot easier.  I also was unable to force a particular PV to be bound to a PVC. They seem to work like a pool and you get what you get. So if you have an existing nfs volume with data you want to mount into a particular pod there might not be a way of doing that with PV's but I would love to be proven wrong by others.  

On 14 October 2016 at 07:32, Seth Jennings <sjenning redhat com> wrote:
NFS mounts can be mounted directly into pods without being PVs like this:

volumes:
  name: shared
  nfs:
    server: <server>
    path: <path>

If you are using NFS PVs, then the persistentVolumeReclaimPolicy
determines if the data is wiped when the PVC is released.  The default
value is "Retain".  It will not delete the data unless you set it to
"Recycle".

https://docs.openshift.com/enterprise/3.0/admin_guide/persistent_storage_nfs.html#reclaiming-resources

Hope that answers your question!

On Thu, Oct 13, 2016 at 10:19 AM, Dean Peterson <peterson dean gmail com> wrote:
> If I create a persistent volume claim using an NFS share that has existing
> data, will the data be wipded? Same thing with creating the persistent
> volume. Will the existing data be deleted. I want to make existing data
> accessible to multiple pods/containers in an NFS share. If I make a
> persistent volume pointing to that existing path. How do I get the
> persistent volume claim to access that existing path and make the containers
> with the claim see it?
>
> _______________________________________________
> users mailing list
> users lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]