Skip to content

Commit b7933f3

Browse files
authored
Merge pull request #92669 from shdeshpa07/OADP-5961-shallow-copy-csi-snapshot
Configuring backupPVC and restorePVC
2 parents 36b4202 + 0f09a4f commit b7933f3

File tree

4 files changed

+157
-0
lines changed

4 files changed

+157
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,6 +3696,8 @@ Topics:
36963696
File: about-oadp-data-mover
36973697
- Name: Backing up and restoring volumes by using CSI snapshots data movement
36983698
File: oadp-backup-restore-csi-snapshots
3699+
- Name: Configuring backupPVC and restorePVC for Data Mover
3700+
File: configuring-backup-restore-pvc-datamover
36993701
- Name: Overriding Kopia algorithms
37003702
File: overriding-kopia-algorithms
37013703
- Name: OADP API
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="configuring-backup-restore-pvc-datamover"]
3+
= Configuring backup and restore PVCs for Data Mover
4+
include::_attributes/common-attributes.adoc[]
5+
:context: configuring-backup-restore-pvc-datamover
6+
7+
toc::[]
8+
9+
A backup PVC is an intermediate persistent volume claim (PVC) to store data during the data movement backup operation. For some storage classes, such as, CephFS, creating a read-only volume from a snapshot results in faster Data Mover backups.
10+
11+
You create a `readonly` backup PVC by using the `nodeAgent.backupPVC` section of the `DataProtectionApplication` (DPA) and setting the `readOnly` access mode to `true`.
12+
13+
You can use the following fields in the `nodeAgent.backupPVC` section of the DPA to configure the backup PVC.
14+
15+
* `storageClass`: The name of the storage class to use for the backup PVC.
16+
* `readOnly`: Indicates if the backup PVC should be mounted as read-only. Setting this field to `true` also requires you to set the `spcNoRelabeling` field to `true`.
17+
* `spcNoRelabeling`: Disables automatic relabeling of the volume if set to `true`. You can set this field to `true` only when `readOnly` is `true`. When the `readOnly` flag is `true`, SELinux relabeling of the volume is not possible. This causes the Data Mover backup to fail. Therefore, when you are using the `readOnly` access mode for the CephFS storage class, you must disable relabeling.
18+
19+
include::modules/oadp-configuring-backup-pvc-datamover-backup.adoc[leveloffset=+1]
20+
21+
include::modules/oadp-configuring-restore-pvc-datamover-restore.adoc[leveloffset=+1]
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/installing/configuring-backup-restore-pvc-datamover.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-backup-pvc_{context}"]
7+
= Configuring a backup PVC for a Data Mover backup
8+
9+
Use the `nodeAgent.backupPVC` section of the `DataProtectionApplication` (DPA) object to configure the backup persistent volume claim (PVC) for a storage class.
10+
11+
.Prerequisites
12+
13+
* You have installed the {oadp-short} Operator.
14+
15+
.Procedure
16+
17+
. Configure the `nodeAgent.backupPVC` section in the DPA as shown in the following example:
18+
+
19+
.Example Data Protection Application
20+
[source,yaml]
21+
----
22+
apiVersion: oadp.openshift.io/v1alpha1
23+
kind: DataProtectionApplication
24+
metadata:
25+
name: ts-dpa
26+
namespace: openshift-adp
27+
spec:
28+
backupLocations:
29+
- velero:
30+
credential:
31+
key: cloud
32+
name: cloud-credentials-gcp
33+
default: true
34+
objectStorage:
35+
bucket: oadp...2jw
36+
prefix: velero
37+
provider: gcp
38+
configuration:
39+
nodeAgent:
40+
enable: true
41+
uploaderType: kopia
42+
backupPVC: # <1>
43+
storage-class-1:
44+
readOnly: true # <2>
45+
spcNoRelabeling: true # <3>
46+
storageClass: gp3-csi
47+
storage-class-2:
48+
readOnly: false
49+
spcNoRelabeling: false
50+
storageClass: gp3-csi
51+
velero:
52+
defaultPlugins:
53+
- gcp
54+
- openshift
55+
- csi
56+
----
57+
<1> In this example, the `backupPVC` section has configurations for two storage classes, `storage-class-1` and `storage-class-2`.
58+
<2> The `backupPVC` for `storage-class-1` is configured as `readOnly`.
59+
<3> Because the `backupPVC` for `storage-class-1` is `readOnly`, the `spcNoRelabeling` field is set to `true`.
60+
61+
. Create a `Backup` custom resource by using the following configuration:
62+
+
63+
.Example Backup
64+
[source,yaml]
65+
----
66+
apiVersion: velero.io/v1
67+
kind: Backup
68+
metadata:
69+
name: test-backup
70+
namespace: openshift-adp
71+
spec:
72+
includedNamespaces:
73+
- <application_namespace>
74+
snapshotMoveData: true # <1>
75+
----
76+
<1> Set to `true` for a Data Mover backup.
77+
78+
.Verification
79+
80+
* Verify that the backup PVCs are created as read-only (`ROX`) by running the following command:
81+
+
82+
.Example command
83+
[source,terminal]
84+
----
85+
$ oc get pvc -n openshift-adp -w
86+
----
87+
+
88+
[source,terminal]
89+
----
90+
test-backup1-l..d Bound pvc-1298.....22f8 2Gi ROX standard-csi <unset> 37s
91+
test-backup1-l..d Bound pvc-1298....022f8 2Gi ROX standard-csi <unset> 37s
92+
----
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/installing/configuring-backup-restore-pvc-datamover.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-restore-pvc_{context}"]
7+
= Configuring a restorePVC for a Data Mover restore
8+
9+
A `restorePVC` is an intermediate PVC that is used to write data during the Data Mover restore operation.
10+
11+
You can configure the `restorePVC` in the `DataProtectionApplication` (DPA) object by using the `ignoreDelayBinding` field. Setting the `ignoreDelayBinding` field to `true` allows the restore operation to ignore the `WaitForFirstConsumer` binding mode. The data movement restore operation then creates the restore pod and provisions the associated volume to an arbitrary node.
12+
13+
The `ignoreDelayBinding` setting is helpful in scenarios where multiple volume restores are happening in parallel. With the `ignoreDelayBinding` field set to `true`, the restore pods can be spread evenly to all nodes.
14+
15+
.Prerequisites
16+
17+
* You have installed the {oadp-short} Operator.
18+
* You have a created a Data Mover backup of an application.
19+
20+
.Procedure
21+
22+
* Configure the `restorePVC` section in the DPA as shown in the following example:
23+
+
24+
.Example Data Protection Application
25+
[source,yaml]
26+
----
27+
apiVersion: oadp.openshift.io/v1alpha1
28+
kind: DataProtectionApplication
29+
metadata:
30+
name: ts-dpa
31+
namespace: openshift-adp
32+
spec:
33+
# ...
34+
configuration:
35+
nodeAgent:
36+
enable: true
37+
uploaderType: kopia
38+
restorePVC: # <1>
39+
ignoreDelayBinding: true # <2>
40+
----
41+
<1> Add the `restorePVC` section.
42+
<2> Set the `ignoreDelayBinding` field to `true`.

0 commit comments

Comments
 (0)