Creating a clone or restoring a snapshot with the new readonly access mode
With the Red Hat OpenShift Container Storage 4.7, you can create a clone or restore a volume snapshot with the readonly (ROX) access mode.
NOTE1. This feature was development preview, BUT GA (general Available) and fully supported since ODF 4.15 or higher
NOTE2. If you want to use this feature with OADP, you should be on OADP 1.5 (this version of OADP 1.5 is supported in OCP 4.19)
Creating a clone using the ROX access mode
Prequisites
- Source PVC must be in a Bound state and must not be in use.
NOTE: Do not create a clone of a PVC if a Pod is using it. Doing so might cause data corruption because the PVC is not quiesced (paused).
Procedure
- Click Storage → Persistent Volume Claims from the OpenShift Web Console.
- To create a clone, click the action menu (:) next to the PVC of which a clone has to be created → Clone PVC.
- Enter a Name for the clone.
- Select the access mode as ReadOnly (ROX).
- Click Clone. You are redirected to the new PVC details page.
- Wait for the cloned PVC status to become Bound.
The cloned PVC is now available to be consumed by the pods. This cloned PVC is independent of its dataSource PVC.
Restoring volume snapshots using the ROX access mode
When you restore a volume snapshot, a new Persistent Volume Claim (PVC) gets created. The restored PVC is independent of the volume snapshot and the parent PVC.
You can restore a volume snapshot from either the Persistent Volume Claim page or the Volume Snapshots page.
Procedure
From the Persistent Volume Claims page
You can restore the volume snapshot from the Persistent Volume Claims page only if the parent PVC is present.
- Click Storage → Persistent Volume Claims from the OpenShift Web Console.
- To restore a volume snapshot as a new PVC, click on the PVC name with the volume snapshot.
- In the Volume Snapshots tab, click the Action menu (⋮) next to the volume snapshot you want to restore.
- Click Restore as new PVC.
- Enter a name for the new PVC.
- Select the access mode as ReadOnly (ROX).
- Select the Storage Class name.
NOTE: For Rados Block Device (RBD), you must select a storage class using the same storage pool as that of the parent PVC.
- Click Restore. You are redirected to the new PVC details page.
From the Volume Snapshots page
- Click Storage → Volume Snapshots from the OpenShift Web Console.
- Click the Action menu (⋮) next to the volume snapshot you want to restore.
- Click → Restore as new PVC.
- Enter a name for the new PVC.
- Select the access mode as ReadOnly (ROX).
NOTE: For Rados Block Device (RBD), you must select a storage class using the same storage pool as that of the parent PVC.
- Click Restore. You are redirected to the new PVC details page.
Verification steps
- Click Storage → Persistent Volume Claims from the OpenShift Web Console and confirm that the new PVC is listed on the Persistent Volume Claims page.
- Wait for the new PVC to reach Bound state.