Skip to content

Commit 047d1cf

Browse files
authored
Merge pull request #60936 from RichardHoch/oadp_12_ceph
OADP 1.2 Data Mover with Ceph
2 parents 4971c38 + 8f218c6 commit 047d1cf

File tree

8 files changed

+557
-9
lines changed

8 files changed

+557
-9
lines changed

_attributes/common-attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ endif::[]
182182
:run-once-operator: Run Once Duration Override Operator
183183
// Web terminal
184184
:web-terminal-op: Web Terminal Operator
185-
:devworkspace-op: DevWorkspace Operator
185+
:devworkspace-op: DevWorkspace Operator

backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ include::snippets/technology-preview.adoc[]
2121
2222
[IMPORTANT]
2323
====
24-
The OpenShift API for Data Protection (OADP) does not support backing up volume snapshots that were created by other software.
24+
The {oadp-first} does not support backing up volume snapshots that were created by other software.
2525
====
2626

2727
You can create backup hooks to run commands before or after the backup operation. See xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#oadp-creating-backup-hooks_backing-up-applications[Creating backup hooks].
@@ -33,10 +33,27 @@ include::modules/oadp-backing-up-pvs-csi.adoc[leveloffset=+1]
3333
include::modules/oadp-backing-up-applications-restic.adoc[leveloffset=+1]
3434
include::modules/oadp-using-data-mover-for-csi-snapshots.adoc[leveloffset=+1]
3535

36+
[id="oadp-12-data-mover-ceph"]
37+
== Using OADP 1.2 Data Mover with Ceph storage
38+
39+
You can use OADP 1.2 Data Mover to backup and restore application data for clusters that use CephFS, CephRBD, or both.
40+
41+
OADP 1.2 Data Mover leverages Ceph features that support large-scale environments. One of these is the shallow copy method, which is available for {product-title} 4.12 and later. This feature supports backing up and restoring `StorageClass` and `AccessMode` resources other than what is found on the source persistent valune claim (PVC).
42+
43+
[IMPORTANT]
44+
====
45+
The CephFS shallow copy feature is a back up feature. It is not part of restore operations.
46+
====
47+
48+
include::modules/oadp-ceph-prerequisites.adoc[leveloffset=+2]
49+
include::modules/oadp-ceph-preparing-crs.adoc[leveloffset=+2]
50+
include::modules/oadp-ceph-cephfs.adoc[leveloffset=+2]
51+
include::modules/oadp-ceph-split.adoc[leveloffset=+2]
52+
3653
[id="oadp-cleaning-up-after-data-mover-1-1-backup"]
37-
== Cleaning up after a backup using Data Mover with OADP 1.1.
54+
== Cleaning up after a backup using OADP 1.1 Data Mover
3855

39-
For OADP 1.1, you must perform a data cleanup after you perform a backup using any version of Data Mover.
56+
For OADP 1.1 Data Mover, you must perform a data cleanup after you perform a backup.
4057

4158
The cleanup consists of deleting the following resources:
4259

@@ -49,7 +66,7 @@ include::modules/oadp-cleaning-up-after-data-mover-snapshots.adoc[leveloffset=+2
4966
[id="deleting-cluster-resources"]
5067
=== Deleting cluster resources
5168

52-
Data Mover might leave cluster resources whether or not it successfully backs up your container storage interface (CSI) volume snapshots to a remote object store.
69+
OADP 1.1 Data Mover might leave cluster resources whether or not it successfully backs up your container storage interface (CSI) volume snapshots to a remote object store.
5370

5471
include::modules/oadp-deleting-cluster-resources-following-success.adoc[leveloffset=+3]
5572
include::modules/oadp-deleting-cluster-resources-following-failure.adoc[leveloffset=+3]
@@ -67,4 +84,4 @@ include::modules/oadp-deleting-backups.adoc[leveloffset=+1]
6784

6885
[role="_additional-resources"]
6986
.Additional resources
70-
* xref:../../../backup_and_restore/application_backup_and_restore/troubleshooting.adoc#velero-obtaining-by-downloading_oadp-troubleshooting[Downloading the Velero CLI tool]
87+
* xref:../../../backup_and_restore/application_backup_and_restore/troubleshooting.adoc#velero-obtaining-by-downloading_oadp-troubleshooting[Downloading the Velero CLI tool]

modules/oadp-ceph-cephfs.adoc

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="oadp-ceph-cephfs_{context}"]
7+
= Backing up and restoring data using OADP 1.2 Data Mover and CephFS storage
8+
9+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to back up and restore data using CephFS storage by enabling the shallow copy feature of CephFS.
10+
11+
.Prerequisites
12+
13+
* A stateful application is running in a separate namespace with persistent valune claims (PVCs) using CephFS as the provisioner.
14+
* The `StorageClass` and `VolumeSnapshotClass` CRs are defined for CephFS and OADP 1.2 Data Mover.
15+
* There is a secret `cloud-credentials` in the `openshift-adp` namespace.
16+
17+
.Procedure
18+
19+
. Verify that `deletionPolicy` of the `VolumeSnapshotClass` CR is set to `Retain` by running the following command:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc get volumesnapshotclass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"Retention Policy: "}{.deletionPolicy}{"\n"}{end}'
24+
----
25+
26+
. Verify that the labels of the `VolumeSnapshotClass` CR are set to `true` by running the following command:
27+
+
28+
[source,terminal]
29+
----
30+
$ oc get volumesnapshotclass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"labels: "}{.metadata.labels}{"\n"}{end}'
31+
----
32+
33+
. Verify that the `storageclass.kubernetes.io/is-default-class` annotation of the `StorageClass` CR is set to `true` by running the following command:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc get storageClass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"annotations: "}{.metadata.annotations}{"\n"}{end}'
38+
----
39+
40+
. Create a Data Protection Application (DPA) CR similar to the following.
41+
+
42+
.Example DPA CR
43+
+
44+
[source,yaml]
45+
----
46+
apiVersion: oadp.openshift.io/v1alpha1
47+
kind: DataProtectionApplication
48+
metadata:
49+
name: velero-sample
50+
namespace: openshift-adp
51+
spec:
52+
backupLocations:
53+
- velero:
54+
config:
55+
profile: default
56+
region: us-east-1
57+
credential:
58+
key: cloud
59+
name: cloud-credentials
60+
default: true
61+
objectStorage:
62+
bucket: <my-bucket>
63+
prefix: velero
64+
provider: aws
65+
configuration:
66+
restic:
67+
enable: false <1>
68+
velero:
69+
defaultPlugins:
70+
- openshift
71+
- aws
72+
- csi
73+
- vsm
74+
features:
75+
dataMover:
76+
credentialName: <restic-secret-name> <2>
77+
enable: true <3>
78+
volumeOptionsForStorageClasses:
79+
ocs-storagecluster-cephfs:
80+
sourceVolumeOptions:
81+
accessMode: ReadOnlyMany
82+
cacheAccessMode: ReadWriteMany
83+
cacheStorageClassName: ocs-storagecluster-cephfs
84+
storageClassName: ocs-storagecluster-cephfs-shallow
85+
----
86+
<1> There is no default value for the `enable` field. Valid values are `true` or `false`.
87+
<2> Use the Restic `Secret` that you created when you prepared your environment for working with OADP 1.2 Data Mover and Ceph. If you do not, then the CR will use the default value `dm-credential` for this parameter.
88+
<3> There is no default value for the `enable` field. Valid values are `true` or `false`.
89+
90+
. To back up data, complete the following steps:
91+
92+
.. Create a `Backup` CR similar to the following:
93+
+
94+
.Example `Backup` CR
95+
+
96+
[source,yaml]
97+
----
98+
apiVersion: velero.io/v1
99+
kind: Backup
100+
metadata:
101+
name: <backup-name>
102+
namespace: <protected-ns>
103+
spec:
104+
includedNamespaces:
105+
- <app-ns>
106+
storageLocation: velero-sample-1
107+
----
108+
109+
.. Monitor the progress of the `VolumeSnapshotBackup` CRs by doing the following:
110+
... To check the progress of all the `VolumeSnapshotBackup` CRs, run the following command:
111+
+
112+
[source, terminal]
113+
----
114+
$ oc get vsb -n <app-ns>
115+
----
116+
117+
... To check the progress of a specific `VolumeSnapshotBackup` CR, run the following command:
118+
+
119+
[source,terminal]
120+
----
121+
$ oc get vsb <vsb-name> -n <app-ns> -ojsonpath="{.status.phase}`
122+
----
123+
124+
.. Wait several minutes until the `VolumeSnapshotBackup` CR has the status `Completed`.
125+
.. Verify that there is at least one snapshot in the object store that is given in the Restic `secret`. You can check for this snapshot in your targeted `BackupStorageLocation` storage provider that has a prefix of `/<OADP-namespace>`.
126+
127+
. To restore data, complete the following steps:
128+
129+
.. Delete the application namespace by running the following command:
130+
+
131+
[source,terminal]
132+
----
133+
$ oc delete vsb -n <app_namespace> --all
134+
----
135+
136+
.. Delete any `VolumeSnapshotContent` CRs that were created during backup by by running the following command:
137+
+
138+
[source,terminal]
139+
----
140+
$ oc oc delete volumesnapshotcontent --all
141+
----
142+
143+
.. Create a `Restore` CR similar to the following:
144+
+
145+
.Example `Restore` CR
146+
+
147+
[source,yaml]
148+
----
149+
apiVersion: velero.io/v1
150+
kind: Restore
151+
metadata:
152+
name: <restore-name>
153+
namespace: <protected-ns>
154+
spec:
155+
backupName: <previous-backup-name>
156+
----
157+
158+
.. Monitor the progress of the `VolumeSnapshotRestore` CRs by doing the following:
159+
... To check the progress of all the `VolumeSnapshotRestore` CRs, run the following command:
160+
+
161+
[source, terminal]
162+
----
163+
$ oc get vsr -n <app-ns>
164+
----
165+
166+
... To check the progress of a specific `VolumeSnapshotRestore` CR, run tc:
167+
+
168+
[source,terminal]
169+
----
170+
$ oc get vsr <vsr-name> -n <app-ns> -ojsonpath="{.status.phase}
171+
----
172+
173+
.. Verify that your application data has been restored by running the following command:
174+
+
175+
[source,terminal]
176+
----
177+
$ oc get route <route-name> -n <app-ns> -ojsonpath="{.spec.host}"
178+
----

0 commit comments

Comments
 (0)