// Module included in the following assemblies:
//
// * storage/container_storage_interface/persistent-storage-csi-vsphere.adoc
//

:_mod-docs-content-type: PROCEDURE
[id="persistent-storage-csi-vsphere-encryption-datastore-url_{context}"]
= Using datastore URL

[role="_abstract"]
To encrypt persistent volumes by targeting a specific datastore, create a storage class that references an encryption-enabled storage policy and datastore URL.

.Procedure
. Find out the name of the default storage policy in your datastore that supports encryption. 
+
This is same policy that was used for encrypting your VMs. 

. Create a storage class that uses this storage policy:
+
[source, yaml]
----
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
 name: encryption
provisioner: csi.vsphere.vmware.com
parameters:
 storagePolicyName: <storage-policy-name>
 datastoreurl: "ds:///vmfs/volumes/vsan:522e875627d-b090c96b526bb79c/"
----
+
`parameters.storagePolicyName` is the name of the default storage policy in your datastore that supports encryption.