|
| 1 | +# DataProtectionTest (DPT) CR usage documentation |
| 2 | + |
| 3 | +This document explains the usage of the `DataProtectionTest` (DPT) custom resource introduced by the OADP Operator. |
| 4 | +It covers configuration, available fields, behavior, and example workflows. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +The `DataProtectionTest` (`dpt`) Custom Resource (CR) provides a framework to **validate** and **measure**: |
| 11 | + |
| 12 | +- **Upload performance** to the object storage backend. |
| 13 | +- **CSI snapshot readiness** for PersistentVolumeClaims. |
| 14 | +- **Storage bucket configuration** (encryption/versioning for S3 providers). |
| 15 | + |
| 16 | +This enables users to ensure their data protection environment is properly configured and performant. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Spec Fields |
| 21 | + |
| 22 | +| Field | Type | Description | |
| 23 | +|:------|:-----|:------------| |
| 24 | +| `backupLocationName` | string | Name of the existing BackupStorageLocation to use. | |
| 25 | +| `backupLocationSpec` | object | Inline specification of the BackupStorageLocation (mutually exclusive with `backupLocationName`). | |
| 26 | +| `uploadSpeedTestConfig` | object | Configuration to run an upload speed test to object storage. | |
| 27 | +| `csiVolumeSnapshotTestConfigs` | list | List of PVCs to snapshot and verify snapshot readiness. | |
| 28 | +| `forceRun` | boolean | Re-run the DPT even if status is already `Complete` or `Failed`. | |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Status Fields |
| 33 | + |
| 34 | +| Field | Type | Description | |
| 35 | +|:------|:-----|:------------| |
| 36 | +| `phase` | string | Current phase: `InProgress`, `Complete`, or `Failed`. | |
| 37 | +| `lastTested` | timestamp | Last time the tests were run. | |
| 38 | +| `uploadTest` | object | Results of the upload speed test. | |
| 39 | +| `bucketMetadata` | object | Information about the storage bucket encryption and versioning. | |
| 40 | +| `snapshotTests` | list | Per-PVC snapshot test results. | |
| 41 | +| `snapshotSummary` | string | Aggregated pass/fail summary for snapshots (e.g., `2/2 passed`). | |
| 42 | +| `s3Vendor` | string | Detected S3-compatible vendor (e.g., `AWS`, `MinIO`, `Ceph`). | |
| 43 | +| `errorMessage` | string | Top-level error message if the DPT fails. | |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +Notes: |
| 48 | + |
| 49 | +- If DPT `status.phase` is `Complete` or `Failed` **and** `forceRun` is `false`, the controller **skips** re-running tests. |
| 50 | +- If `forceRun: true`, the tests will re-execute, and `forceRun` is reset to `false` after execution. |
| 51 | +- During a test run, the phase transitions: |
| 52 | + - `InProgress` -> `Complete` (on success) |
| 53 | + - `InProgress` -> `Failed` (on error) |
| 54 | +- Upload test and snapshot tests are optional based on the spec fields populated. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Printer Columns |
| 59 | + |
| 60 | +When running: |
| 61 | + |
| 62 | +```bash |
| 63 | +oc get dpt dpt-sample-1 -n openshift-adp |
| 64 | +``` |
| 65 | + |
| 66 | +You will see: |
| 67 | + |
| 68 | +```bash |
| 69 | +NAME PHASE LASTTESTED UPLOADSPEED(MBPS) ENCRYPTION VERSIONING SNAPSHOTS AGE |
| 70 | +dpt-sample-1 Complete 72s 660 AES256 None 2/2 passed 72s |
| 71 | +``` |
| 72 | + |
| 73 | +| Column | Description | |
| 74 | +|:-------|:------------| |
| 75 | +| Phase | Current phase of the DPT (`InProgress`, `Complete`, `Failed`). | |
| 76 | +| LastTested | Timestamp of the last test run. | |
| 77 | +| UploadSpeed(Mbps) | Upload speed result to the object storage. | |
| 78 | +| Encryption | Storage bucket encryption algorithm (e.g., `AES256`). | |
| 79 | +| Versioning | Storage bucket versioning state (e.g., `Enabled`, `Suspended`). | |
| 80 | +| Snapshots | Pass/fail summary of snapshot tests (e.g., `2/2 passed`). | |
| 81 | +| Age | Time since the DPT resource was created. | |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Example DataProtectionTest (DPT) CR |
| 86 | +- Example 1 |
| 87 | +```yaml |
| 88 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 89 | +kind: DataProtectionTest |
| 90 | +metadata: |
| 91 | + name: dpt-sample |
| 92 | + namespace: openshift-adp |
| 93 | +spec: |
| 94 | + backupLocationName: sample-bsl |
| 95 | + uploadSpeedTestConfig: |
| 96 | + fileSize: 5MB |
| 97 | + timeout: 60s |
| 98 | + csiVolumeSnapshotTestConfigs: |
| 99 | + - volumeSnapshotSource: |
| 100 | + persistentVolumeClaimName: mysql |
| 101 | + persistentVolumeClaimNamespace: mysql-persistent |
| 102 | + snapshotClassName: csi-snapclass |
| 103 | + timeout: 2m |
| 104 | + forceRun: true |
| 105 | +``` |
| 106 | +
|
| 107 | +- Example 2 |
| 108 | +```yaml |
| 109 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 110 | +kind: DataProtectionTest |
| 111 | +metadata: |
| 112 | + name: dpt-sample |
| 113 | + namespace: openshift-adp |
| 114 | +spec: |
| 115 | + backupLocationSpec: |
| 116 | + provider: aws |
| 117 | + default: true |
| 118 | + objectStorage: |
| 119 | + bucket: sample-bucket |
| 120 | + prefix: velero |
| 121 | + config: |
| 122 | + region: us-east-1 |
| 123 | + profile: "default" |
| 124 | + insecureSkipTLSVerify: "true" |
| 125 | + s3Url: "https://s3.amazonaws.com/sample-bucket" |
| 126 | + credential: |
| 127 | + name: cloud-credentials |
| 128 | + key: cloud |
| 129 | + uploadSpeedTestConfig: |
| 130 | + fileSize: 50MB |
| 131 | + timeout: 120s |
| 132 | + csiVolumeSnapshotTestConfigs: |
| 133 | + - volumeSnapshotSource: |
| 134 | + persistentVolumeClaimName: mongo |
| 135 | + persistentVolumeClaimNamespace: mongo-persistent |
| 136 | + snapshotClassName: csi-snapclass |
| 137 | + timeout: 2m |
| 138 | + forceRun: true |
| 139 | +``` |
| 140 | +--- |
| 141 | +
|
| 142 | +## Key Notes |
| 143 | +
|
| 144 | +- `uploadSpeedTestConfig` is optional. If not provided, upload tests are skipped. |
| 145 | +- `csiVolumeSnapshotTestConfigs` is optional. If not provided, snapshot tests are skipped. |
| 146 | +- Upload tests require appropriate cloud provider secrets. |
| 147 | +- Snapshot tests require VolumeSnapshotClass and CSI snapshot support in the cluster. |
| 148 | +- The referenced **PersistentVolumeClaims must already exist** in the cluster **before** running the DPT. The controller does **not** create or provision PVCs. |
| 149 | +- Set `forceRun: true` manually if you want to rerun tests without recreating the CR. |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## Common Troubleshooting |
| 154 | + |
| 155 | +| Symptom | Possible Cause | Resolution | |
| 156 | +|:--------|:---------------|:-----------| |
| 157 | +| DPT stuck in `InProgress` | Credentials or bucket access failure | Check Secret, bucket permissions, and logs. | |
| 158 | +| Upload test failed | Incorrect secret or S3 endpoint | Validate BackupStorageLocation config and access keys. | |
| 159 | +| Snapshot tests fail | CSI snapshot controller misconfiguration | Check VolumeSnapshotClass availability and CSI driver logs. | |
| 160 | +| Bucket encryption/versioning not populated | Cloud provider limitations | Not all object stores expose these fields consistently. | |
| 161 | + |
| 162 | +--- |
| 163 | + |
0 commit comments