1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00

CNV-9235: Modify smart-cloning topic to use storage API

This commit is contained in:
Bob Gaydos
2021-06-21 12:35:46 -04:00
committed by openshift-cherrypick-robot
parent a50bf6a937
commit 94d93a6e71

View File

@@ -7,21 +7,18 @@
.Prerequisites
For smart-cloning to occur, the following conditions are required.
For smart-cloning to occur, the following conditions are required:
* Your storage provider must support snapshots.
* The source and target PVCs must be defined to the same namespace.
* The source and target PVCs must be defined to the same storage class.
* The `VolumeSnapshotClass` object must reference the storage class defined to both the source and target PVCs.
If any of these prerequisites are not met, host-assisted cloning automatically occurs when you create a data volume with a PVC source.
.Procedure
To initiate cloning of a data volume:
. Create a YAML file for a `DataVolume` object that specifies the name of the
new data volume, the name and namespace of the source PVC, and the size of the new data volume. This example clones a source PVC in block mode, so `volumeMode: Block` is used:
new data volume and the name and namespace of the source PVC. In this example, because you specify the *storage* API, there is no need to specify *accessModes* or *volumeMode*. The optimal values will be calculated for you automatically.
+
[source,yaml]
----
@@ -33,21 +30,17 @@ spec:
source:
pvc:
namespace: "<source-namespace>" <2>
name: "<my-favorite-vm-disk>" <3>
pvc:
accessModes:
- ReadWriteMany
name: "<my-favorite-vm-disk>" <3>)
storage: <4>
resources:
requests:
storage: <2Gi> <4>
volumeMode: Block <5>
storage: <2Gi> <5>
----
<1> The name of the new data volume.
<2> The namespace where the source PVC exists.
<3> The name of the source PVC.
<4> The size of the new data volume. You must allocate enough space, or the
cloning operation fails. The size must be the same as or larger than the source PVC.
<5> Specifies that the destination is a block PV.
<4> Specifies allocation with the *storage* API
<5> The size of the new data volume.
. Start cloning the PVC by creating the data volume:
+