Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/persistent-storage-csi-cloning-overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
[id="persistent-storage-csi-cloning-overview_{context}"]
= Overview of CSI volume cloning

A Container Storage Interface (CSI) volume clone is a duplicate of an existing persistent volume at a particular point in time.
[role="_abstract"]
You can use Container Storage Interface (CSI) volume clones to create point-in-time duplicates of existing persistent volumes.

Volume cloning is similar to volume snapshots, although it is more efficient. For example, a cluster administrator can duplicate a cluster volume by creating another instance of the existing cluster volume.

Cloning creates an exact duplicate of the specified volume on the back-end device, rather than creating a new empty volume. After dynamic provisioning, you can use a volume clone just as you would use any standard volume.

No new API objects are required for cloning. The existing `dataSource` field in the `PersistentVolumeClaim` object is expanded so that it can accept the name of an existing PersistentVolumeClaim in the same namespace.

Before you provision a CSI volume clone, you should be familiar with persistent volumes. For information about persistent volumes, see _Understanding persistent volumes_ in _Additional resources_.

== Support limitations

By default, {product-title} supports CSI volume cloning with these limitations:
Expand Down
21 changes: 11 additions & 10 deletions modules/persistent-storage-csi-cloning-provisioning.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[id="persistent-storage-csi-cloning-provisioning_{context}"]
= Provisioning a CSI volume clone

[role="_abstract"]
Create a new persistent volume claim (PVC) that specifies an existing PVC as its data source. The new volume automatically populates with a copy of the source PVC's data and must be created in the same namespace as the source.

When you create a cloned persistent volume claim (PVC) API object, you trigger the provisioning of a CSI volume clone. The clone pre-populates with the contents of another PVC, adhering to the same rules as any other persistent volume. The one exception is that you must add a `dataSource` that references an existing PVC in the same namespace.

.Prerequisites
Expand All @@ -15,12 +18,9 @@ When you create a cloned persistent volume claim (PVC) API object, you trigger t

.Procedure

To clone a PVC from an existing PVC:

. Create and save a file with the `PersistentVolumeClaim` object described by the following YAML:

+
.pvc-clone.yaml
.Example pvc-clone.yaml
[source,yaml]
----
apiVersion: v1
Expand All @@ -29,7 +29,7 @@ metadata:
name: pvc-1-clone
namespace: mynamespace
spec:
storageClassName: csi-cloning <1>
storageClassName: csi-cloning
accessModes:
- ReadWriteOnce
resources:
Expand All @@ -40,7 +40,7 @@ spec:
name: pvc-1
----
+
<1> The name of the storage class that provisions the storage back end. The default storage class can be used and `storageClassName` can be omitted in the spec.
Where `spec.storageClassName` is the name of the storage class that provisions the storage back end. The default storage class can be used and `storageClassName` can be omitted in the spec.
+
. Create the object you saved in the previous step by running the following command:
+
Expand All @@ -64,7 +64,7 @@ You are now ready to use the newly cloned PVC to configure a pod.

. Create and save a file with the `Pod` object described by the YAML. For example:
+

.Example pod YAML file
[source,yaml]
----
kind: Pod
Expand All @@ -81,9 +81,10 @@ spec:
volumes:
- name: mypd
persistentVolumeClaim:
claimName: pvc-1-clone <1>
claimName: pvc-1-clone
----
+
<1> The cloned PVC created during the CSI volume cloning operation.
+
Where `spec.volumes.persistentVolumeClaim.claimName` is the cloned PVC created during the CSI volume cloning operation.

.Result
The created `Pod` object is now ready to consume, clone, snapshot, or delete your cloned PVC independently of its original `dataSource` PVC.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ include::_attributes/common-attributes.adoc[]

toc::[]

Volume cloning duplicates an existing persistent volume to help protect against data loss in {product-title}. This feature is only available with supported Container Storage Interface (CSI) drivers. You should be familiar with xref:../../storage/understanding-persistent-storage.adoc#persistent-volumes_understanding-persistent-storage[persistent volumes] before you provision a CSI volume clone.
[role="_abstract"]
Container Storage Interface (CSI) volume cloning duplicates existing persistent volumes to create independent copies for data protection, testing, or deployment. You can use cloning to create new volumes from existing data without manual copying or backup restoration.

include::modules/persistent-storage-csi-cloning-overview.adoc[leveloffset=+1]

include::modules/persistent-storage-csi-cloning-provisioning.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources
* xref:../../storage/understanding-persistent-storage.adoc#persistent-volumes_understanding-persistent-storage[Understanding persistent volumes]