From dff6ea44243aef99ee14dbcfbce5ac4b034374c7 Mon Sep 17 00:00:00 2001 From: vathakur Date: Tue, 15 Apr 2025 17:01:48 +0530 Subject: [PATCH] CNV#47262:Document ODF VolumeSnapshot recommendation for 100s of clones --- ...at-scale-in-openshift-data-foundation.adoc | 37 +++++++++++++++++++ .../virt-creating-vms-by-cloning-pvcs.adoc | 8 ++++ 2 files changed, 45 insertions(+) create mode 100644 modules/virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation.adoc diff --git a/modules/virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation.adoc b/modules/virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation.adoc new file mode 100644 index 0000000000..65b190c0c5 --- /dev/null +++ b/modules/virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation.adoc @@ -0,0 +1,37 @@ +// Module included in the following assemblies: +// +// * virt/virtual_machines/creating_vms_custom/virt-creating-vms-by-cloning-pvcs.adoc + +:_mod-docs-content-type: PROCEDURE +[id="virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation_{context}"] += Optimizing clone Performance at scale in {rh-storage} + +When you use {rh-storage}, the storage profile configures the default cloning strategy as `csi-clone`. However, this method has limitations, as shown in the following link. After a certain number of clones are created from a persistent volume claim (PVC), a background flattening process begins, which can significantly reduce clone creation performance at scale. + +To improve performance when creating hundreds of clones from a single source PVC, use the `VolumeSnapshot` cloning method instead of the default `csi-clone` strategy. + +.Procedure +Create a `VolumeSnapshot` custom resource (CR) of the source image by using the following content: +[source,yaml] +---- +apiVersion: snapshot.storage.k8s.io/v1 +kind: VolumeSnapshot +metadata: + name: golden-volumesnapshot + namespace: golden-ns +spec: + volumeSnapshotClassName: ocs-storagecluster-rbdplugin-snapclass + source: + persistentVolumeClaimName: golden-snap-source +---- + +. Add the `spec.source.snapshot` stanza to reference the `VolumeSnapshot` as the source for the `DataVolume clone`: + +[source,yaml] +---- +spec: + source: + snapshot: + namespace: golden-ns + name: golden-volumesnapshot +---- \ No newline at end of file diff --git a/virt/virtual_machines/creating_vms_custom/virt-creating-vms-by-cloning-pvcs.adoc b/virt/virtual_machines/creating_vms_custom/virt-creating-vms-by-cloning-pvcs.adoc index cabf91ba47..41bc729745 100644 --- a/virt/virtual_machines/creating_vms_custom/virt-creating-vms-by-cloning-pvcs.adoc +++ b/virt/virtual_machines/creating_vms_custom/virt-creating-vms-by-cloning-pvcs.adoc @@ -31,6 +31,14 @@ This method creates a data volume whose lifecycle is independent of the original + This method creates a data volume whose lifecycle is dependent on the original VM. Deleting the original VM deletes the cloned data volume and its associated PVC. +include::modules/virt-optimizing-clone-performance-at-scale-in-openshift-data-foundation.adoc[leveloffset=+2] + +[role="_additional-resources"] +.Additional resources +* xref:../../../virt/storage/virt-configuring-storage-profile.adoc#virt-customizing-storage-profile-default-cloning-strategy_virt-configuring-storage-profile[Setting a default cloning strategy using a storage profile] +* link:https://docs.redhat.com/en/documentation/red_hat_openshift_data_foundation/4.18/html/managing_and_allocating_storage_resources/volume-cloning_rhodf#volume-cloning_rhodf[Volume cloning] +* link:https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/storage/using-container-storage-interface-csi#persistent-storage-csi-snapshots[CSI volume snapshots] + include::modules/virt-cloning-pvc-to-dv-cli.adoc[leveloffset=+2] include::modules/virt-creating-vm-cloned-pvc-data-volume-template.adoc[leveloffset=+2]