OADP Data protection test
Validate your OADP configuration by using the DataProtectionTest (DPT) custom resource (CR). This helps you ensure your data protection environment is properly configured and performing according to your requirements before performing backups.
The DPT checks the upload performance of backups to object storage, CSI snapshot readiness for persistent volume claims, and storage bucket configuration such as encryption and versioning.
OADP DataProtectionTest CR specification fields
Review the specification fields available in the DataProtectionTest (DPT) custom resource (CR) to configure backup location, upload speed tests, CSI volume snapshot tests, and other options. This helps you customize the DPT CR to validate your specific OADP configuration requirements.
DPT CR spec fields
| Field | Type | Description |
|---|---|---|
backupLocationName | string | Name of the BackupStorageLocation CR configured in the DataProtectionApplication (DPA) CR. |
backupLocationSpec | object | Inline specification of the BackupStorageLocation CR. |
uploadSpeedTestConfig | object | Configuration to run an upload speed test to the object storage. |
csiVolumeSnapshotTestConfigs | list | List of persistent volume claims to take a snapshot of and to verify the snapshot readiness. |
forceRun | boolean | Re-run the DPT CR even if status is Complete or Failed. |
skipTLSVerify | boolean | Bypasses the TLS certificate validation if set to true. |
OADP DataProtectionTest CR status fields
Review the status fields in the DataProtectionTest (DPT) custom resource (CR) to monitor test progress, upload speed results, bucket metadata, and snapshot test outcomes. This helps you interpret the DPT CR results and identify any issues with your OADP configuration.
DPT CR status fields
| Field | Type | Description |
|---|---|---|
phase | string | Current phase of the DPT CR. Values are InProgress, Complete, or Failed. |
lastTested | timestamp | The timestamp when the DPT CR was last run. |
uploadTest | object | Results of the upload speed test. |
bucketMetadata | object | Information about the storage bucket encryption and versioning. |
snapshotTests | list | Snapshot test results for each persistent volume claim. |
snapshotSummary | string | Aggregated pass/fail summary for snapshots. For example, 2/2 passed. |
s3Vendor | string | AWS S3-compatible storage bucket vendors. For example, AWS, MinIO, Ceph. |
errorMessage | string | Error message if the DPT CR fails. |
Using the DataProtectionTest custom resource
Configure and run the DataProtectionTest (DPT) custom resource (CR) to verify Container Storage Interface (CSI) snapshot readiness and data upload performance to your storage bucket. This helps you validate your OADP environment before performing backup and restore operations.
Prerequisites
- You have logged in to the OpenShift Container Platform cluster as a user with the
cluster-adminrole. - You have installed the OpenShift CLI (
oc). - You have installed the OADP Operator.
- You have created the
DataProtectionApplication(DPA) CR. - You have configured a backup storage location (BSL) to store the backups.
- You have an application with persistent volume claims (PVCs) running in a separate namespace.
Procedure
-
Create a manifest file for the DPT CR as shown in the example:
apiVersion: oadp.openshift.io/v1alpha1kind: DataProtectionTestmetadata:name: dpt-samplenamespace: openshift-adpspec:backupLocationName: <bsl_name>csiVolumeSnapshotTestConfigs:- snapshotClassName: csi-gce-pd-vsctimeout: 90svolumeSnapshotSource:persistentVolumeClaimName: <pvc1_name>persistentVolumeClaimNamespace: <pvc_namespace>- snapshotClassName: csi-gce-pd-vsctimeout: 120svolumeSnapshotSource:persistentVolumeClaimName: <pvc2_name>persistentVolumeClaimNamespace: <pvc_namespace>forceRun: falseuploadSpeedTestConfig:fileSize: 200MBtimeout: 120swhere:
<bsl_name>- Specifies the name of the BSL.
csiVolumeSnapshotTestConfigs- Specifies a list for
csiVolumeSnapshotTestConfigs. In this example, two PVCs are being tested. <pvc1_name>- Specifies the name of the first PVC.
<pvc_namespace>- Specifies the namespace of the PVC.
<pvc2_name>- Specifies the name of the second PVC.
forceRun- Set to
falseif you want to make the OADP controller skip re-running tests. uploadSpeedTestConfig- Configures the upload speed test by setting the
fileSizeandtimeoutfields.
-
Create the DPT CR by running the following command:
$ oc create -f <dpt_file_name>Replace
<dpt_file_name>with the file name of the DPT manifest.
Verification
-
Verify that the phase of the DPT CR is
Completeby running the following command:$ oc get dpt dpt-sampleThe example output is as following:
NAME PHASE LASTTESTED UPLOADSPEED(MBPS) ENCRYPTION VERSIONING SNAPSHOTS AGEdpt-sample Complete 17m 546 AES256 Enabled 2/2 passed 17m -
Verify that the CSI snapshots are ready and the data upload tests are successful by running the following command:
$ oc get dpt dpt-sample -o yamlThe example output is as following:
apiVersion: oadp.openshift.io/v1alpha1kind: DataProtectionTest....status:bucketMetadata:encryptionAlgorithm: AES256versioningStatus: EnabledlastTested: "202...:47:51Z"phase: Completes3Vendor: AWSsnapshotSummary: 2/2 passedsnapshotTests:- persistentVolumeClaimName: mysql-datapersistentVolumeClaimNamespace: ocp-mysqlreadyDuration: 24sstatus: Ready- persistentVolumeClaimName: mysql-data1persistentVolumeClaimNamespace: ocp-mysqlreadyDuration: 40sstatus: ReadyuploadTest:duration: 3.071sspeedMbps: 546success: truewhere:
bucketMetadata- Specifies the bucket metadata information.
s3Vendor- Specifies the S3 bucket vendor.
snapshotSummary- Specifies the summary of the CSI snapshot tests.
uploadTest- Specifies the upload test details.
Running a data protection test by configuring a backup storage location specification
Configure and run the DataProtectionTest (DPT) custom resource (CR) by specifying an inline backup storage location (BSL) specification instead of referencing an existing BSL name. This helps you test data upload performance and CSI snapshot readiness without creating a separate BSL resource.
Prerequisites
- You have logged in to the OpenShift Container Platform cluster as a user with the
cluster-adminrole. - You have installed the OpenShift CLI (
oc). - You have installed the OADP Operator.
- You have created the
DataProtectionApplication(DPA) CR. - You have configured a bucket to store the backups.
- You have created the
Secretobject to access the bucket storage. - You have an application with persistent volume claims (PVCs) running in a separate namespace.
Procedure
-
Create a manifest file for the DPT CR as shown in the example:
apiVersion: oadp.openshift.io/v1alpha1kind: DataProtectionTestmetadata:name: dpt-samplenamespace: openshift-adpspec:backupLocationSpec:provider: awsdefault: trueobjectStorage:bucket: sample-bucketprefix: veleroconfig:region: us-east-1profile: "default"insecureSkipTLSVerify: "true"s3Url: "https://s3.amazonaws.com/sample-bucket"credential:name: cloud-credentialskey: clouduploadSpeedTestConfig:fileSize: 50MBtimeout: 120scsiVolumeSnapshotTestConfigs:- volumeSnapshotSource:persistentVolumeClaimName: mongopersistentVolumeClaimNamespace: mongo-persistentsnapshotClassName: csi-snapclasstimeout: 2mforceRun: trueskipTLSVerify: truewhere:
backupLocationSpec- Configures the BSL spec by specifying details such as the cloud provider.
sample-bucket- Specifies the bucket name. In this example, the bucket name is
sample-bucket. us-east-1- Specifies the cloud provider region.
credential- Specifies the cloud credentials for the storage bucket.
uploadSpeedTestConfig- (Optional) Configures the upload speed test by setting the
fileSizeandtimeoutfields. csiVolumeSnapshotTestConfigs- Configures the CSI volume snapshot test.
skipTLSVerify- Set to
trueto skip the TLS certificate validation during the DPT CR run.
-
Create the DPT CR by running the following command:
$ oc create -f <dpt_file_name>Replace
<dpt_file_name>with the file name of the DPT manifest.
Verification
-
Verify that the phase of the DPT CR is
Completeby running the following command:$ oc get dpt dpt-sampleThe example output is as following:
NAME PHASE LASTTESTED UPLOADSPEED(MBPS) ENCRYPTION VERSIONING SNAPSHOTS AGEdpt-sample Complete 17m 546 AES256 Enabled 2/2 passed 17m
Running a data protection test on an Azure object storage
Run the DataProtectionTest (DPT) custom resource (CR) on Azure object storage by configuring the required Azure credentials, including the STORAGE_ACCOUNT_ID parameter in the secret object. This helps you validate your OADP configuration and verify CSI snapshot readiness on Azure clusters.
Prerequisites
- You have logged in to the Azure cluster as a user with the
cluster-adminrole. - You have installed the OpenShift CLI (
oc). - You have installed the OADP Operator.
- You have configured a bucket to store the backups.
- You have an application with persistent volume claims (PVCs) running in a separate namespace.
Procedure
-
Add the
Storage Blob Data Contributorrole to AzurestorageAccountobject to avoid DPT run failure. Run the following command:$ az role assignment create \--assignee "$AZURE_CLIENT_ID" \--role "Storage Blob Data Contributor" \--scope "/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$AZURE_RESOURCE_GROUP/providers/Microsoft.Storage/storageAccounts/$AZURE_STORAGE_ACCOUNT_ID" -
In your terminal, export the Azure parameters and create a secret credentials file with the parameters as shown in the following example. To run the DPT CR on Azure, you need to specify the
STORAGE_ACCOUNT_IDparameter in the secret credentials file.AZURE_SUBSCRIPTION_ID=<subscription_id>AZURE_TENANT_ID=<tenant_id>AZURE_CLIENT_ID=<client_id>AZURE_CLIENT_SECRET=<client_secret>AZURE_RESOURCE_GROUP=<resource_group>AZURE_STORAGE_ACCOUNT_ID=<storage_account> -
Create the
SecretCR as shown in the following example:$ oc create secret generic cloud-credentials-azure -n openshift-adp --from-file cloud=<credentials_file_path> -
Create the
DataProtectionApplication(DPA) CR by using the configuration shown in the following example:apiVersion: oadp.openshift.io/v1alpha1kind: DataProtectionApplicationmetadata:name: ts-dpanamespace: openshift-adpspec:configuration:velero:defaultPlugins:- azure- openshiftbackupLocations:- velero:config:resourceGroup: oadp-....-b7q4-rgstorageAccount: oadp...kb7q4subscriptionId: 53b8f5...fd54c8acredential:key: cloudname: cloud-credentials-azureprovider: azuredefault: trueobjectStorage:bucket: <bucket_name>prefix: veleroReplace
namewith the name of theSecretobject. In this example, the name iscloud-credentials-azure. -
Create the DPT CR by specifying the name of backup storage location (BSL),
VolumeSnapshotClassobject, and the persistent volume claim details as shown in the following example:apiVersion: oadp.openshift.io/v1alpha1kind: DataProtectionTestmetadata:name: dpt-samplenamespace: openshift-adpspec:backupLocationName: <bsl_name>uploadSpeedTestConfig:fileSize: 40MBtimeout: 120scsiVolumeSnapshotTestConfigs:- snapshotClassName: csi-azuredisk-vsctimeout: 90svolumeSnapshotSource:persistentVolumeClaimName: mysql-datapersistentVolumeClaimNamespace: ocp-mysql- snapshotClassName: csi-azuredisk-vsctimeout: 120svolumeSnapshotSource:persistentVolumeClaimName: mysql-data1persistentVolumeClaimNamespace: ocp-mysqlwhere:
<bsl_name>- Specifies the name of the BSL.
csi-azuredisk-vsc- Specifies the Azure snapshot class name.
mysql-data- Specifies the name of the persistent volume claim.
ocp-mysql- Specifies the name of the persistent volume claim namespace.
-
Run the DPT CR to verify the snapshot readiness.
Troubleshooting the DataProtectionTest custom resource
Troubleshoot common DataProtectionTest (DPT) custom resource (CR) issues, such as stuck progress states, upload test failures, and snapshot test failures. This helps you identify and resolve problems with your DPT configuration.
DPT CR troubleshooting
| Error | Reason | Solution |
|---|---|---|
DPT stuck in InProgress state | Bucket credentials or bucket access failure | Check Secret object, bucket permissions, and logs. |
| Upload test failed | Incorrect Secret object or S3 endpoint | Check the BackupStorageLocation object config and the access keys. |
| Snapshot tests fail | Incorrect configuration of CSI snapshot controller | Check the VolumeSnapshotClass object availability and the CSI driver logs. |
| Bucket encryption or versioning not populated | Cloud provider limitations | Not all object storage providers expose these fields consistently. |