Chapter 6. Volume cloning for single node OpenShift
A clone is a duplicate of an existing storage volume that can be used like any standard volume. You create a clone of a volume to make a point in time copy of the data. A persistent volume claim (PVC) cannot be cloned with a different size.
6.1. Creating volume clones in single node openshift Copy linkLink copied to clipboard!
Prerequisites
- Ensure that the source PVC is in Bound state and not in use.
- Ensure that the StorageClass is the same as that of the parent.
Procedure
- Identify the storage class of the source PVC.
Save the following YAML to a file with a name such as
odf-lvm-vol-clone.yamlto create a volume clone.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the policy by running the following command:
oc create -f odf-lvm-vol-clone.yaml -ns lvm-policy-ns
# oc create -f odf-lvm-vol-clone.yaml -ns lvm-policy-ns
6.2. Deleting cloned volumes in single node openshift Copy linkLink copied to clipboard!
Procedure
- To delete the cloned volume, you can delete the cloned PVC.
oc delete pvc <clone-pvc-name> -n <namespace>
oc delete pvc <clone-pvc-name> -n <namespace>