Skip to content

Commit 9dbdef4

Browse files
Merge pull request #61428 from RichardHoch/ceph_cleanup
2 parents 0f98458 + d0ca6b6 commit 9dbdef4

13 files changed

+550
-520
lines changed

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

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,51 @@ The CephFS shallow copy feature is a back up feature. It is not part of restore
4646
====
4747

4848
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]
49+
50+
[id="defining-crs-for-12-data-mover"]
51+
=== Defining custom resources for use with OADP 1.2 Data Mover
52+
53+
When you install {rh-storage-first}, it automatically creates default CephFS and a CephRBD `StorageClass` and `VolumeSnapshotClass` custom resources (CRs). You must define these CRs for use with OpenShift API for Data Protection (OADP) 1.2 Data Mover.
54+
55+
After you define the CRs, you must make several other changes to your environment before you can perform your back up and restore operations.
56+
57+
include::modules/oadp-ceph-preparing-cephfs-crs.adoc[leveloffset=+2]
58+
include::modules/oadp-ceph-preparing-cephrbd-crs.adoc[leveloffset=+2]
59+
include::modules/oadp-ceph-preparing-crs-additional.adoc[leveloffset=+2]
60+
61+
[id="oadp-ceph-back-up-restore-cephfs"]
62+
=== Backing up and restoring data using OADP 1.2 Data Mover and CephFS storage
63+
64+
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.
65+
66+
include::snippets/oadp-ceph-cr-prerequisites.adoc[]
67+
68+
:context: !backing-up-applications
69+
70+
:context: cephfs
71+
72+
include::modules/oadp-ceph-cephfs-back-up-dba.adoc[leveloffset=+2]
73+
include::modules/oadp-ceph-cephfs-back-up.adoc[leveloffset=+2]
74+
include::modules/oadp-ceph-cephfs-restore.adoc[leveloffset=+2]
75+
76+
[id="oadp-ceph-split"]
77+
=== Backing up and restoring data using OADP 1.2 Data Mover and split volumes (CephFS and Ceph RBD)
78+
79+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to back up and restore data in an environment that has _split volumes_, that is, an environment that uses both CephFS and CephRBD.
80+
81+
include::snippets/oadp-ceph-cr-prerequisites.adoc[]
82+
83+
:context: !cephfs
84+
85+
:context: split
86+
87+
include::modules/oadp-ceph-split-back-up-dba.adoc[leveloffset=+2]
88+
include::modules/oadp-ceph-cephfs-back-up.adoc[leveloffset=+2]
89+
include::modules/oadp-ceph-cephfs-restore.adoc[leveloffset=+2]
90+
91+
:context: !split
92+
93+
:context: backing-up-applications
5294

5395
[id="oadp-cleaning-up-after-data-mover-1-1-backup"]
5496
== Cleaning up after a backup using OADP 1.1 Data Mover
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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-back-up-dba_{context}"]
7+
= Creating a DPA for use with CephFS storage
8+
9+
You must create a Data Protection Application (DPA) CR before you use the OpenShift API for Data Protection (OADP) 1.2 Data Mover to back up and restore data using CephFS storage.
10+
11+
.Procedure
12+
13+
. Verify that the `deletionPolicy` field of the `VolumeSnapshotClass` CR is set to `Retain` by running the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc get volumesnapshotclass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"Retention Policy: "}{.deletionPolicy}{"\n"}{end}'
18+
----
19+
20+
. Verify that the labels of the `VolumeSnapshotClass` CR are set to `true` by running the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc get volumesnapshotclass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"labels: "}{.metadata.labels}{"\n"}{end}'
25+
----
26+
27+
. Verify that the `storageclass.kubernetes.io/is-default-class` annotation of the `StorageClass` CR is set to `true` by running the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc get storageClass -A -o jsonpath='{range .items[*]}{"Name: "}{.metadata.name}{" "}{"annotations: "}{.metadata.annotations}{"\n"}{end}'
32+
----
33+
34+
. Create a Data Protection Application (DPA) CR similar to the following example:
35+
+
36+
.Example DPA CR
37+
+
38+
[source,yaml]
39+
----
40+
apiVersion: oadp.openshift.io/v1alpha1
41+
kind: DataProtectionApplication
42+
metadata:
43+
name: velero-sample
44+
namespace: openshift-adp
45+
spec:
46+
backupLocations:
47+
- velero:
48+
config:
49+
profile: default
50+
region: us-east-1
51+
credential:
52+
key: cloud
53+
name: cloud-credentials
54+
default: true
55+
objectStorage:
56+
bucket: <my_bucket>
57+
prefix: velero
58+
provider: aws
59+
configuration:
60+
restic:
61+
enable: false <1>
62+
velero:
63+
defaultPlugins:
64+
- openshift
65+
- aws
66+
- csi
67+
- vsm
68+
features:
69+
dataMover:
70+
credentialName: <restic_secret_name> <2>
71+
enable: true <3>
72+
volumeOptionsForStorageClasses:
73+
ocs-storagecluster-cephfs:
74+
sourceVolumeOptions:
75+
accessMode: ReadOnlyMany
76+
cacheAccessMode: ReadWriteMany
77+
cacheStorageClassName: ocs-storagecluster-cephfs
78+
storageClassName: ocs-storagecluster-cephfs-shallow
79+
----
80+
<1> There is no default value for the `enable` field. Valid values are `true` or `false`.
81+
<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 use your Restic `Secret`, the CR uses the default value `dm-credential` for this parameter.
82+
<3> There is no default value for the `enable` field. Valid values are `true` or `false`.

modules/oadp-ceph-cephfs-back-up.adoc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
ifeval::["{context}" == "cephfs"]
6+
:cephfs:
7+
endif::[]
8+
ifeval::["{context}" == "split"]
9+
:split:
10+
endif::[]
11+
12+
:_content-type: PROCEDURE
13+
[id="oadp-ceph-cephfs-back-up_{context}"]
14+
15+
ifdef::cephfs[]
16+
= Backing up data using OADP 1.2 Data Mover and CephFS storage
17+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to back up data using CephFS storage by enabling the shallow copy feature of CephFS storage.
18+
endif::cephfs[]
19+
20+
ifdef::split[]
21+
= Backing up data using OADP 1.2 Data Mover and split volumes
22+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to back up data in an environment that has split volumes.
23+
endif::split[]
24+
25+
.Procedure
26+
27+
. Create a `Backup` CR as in the following example:
28+
+
29+
.Example `Backup` CR
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: velero.io/v1
34+
kind: Backup
35+
metadata:
36+
name: <backup_name>
37+
namespace: <protected_ns>
38+
spec:
39+
includedNamespaces:
40+
- <app_ns>
41+
storageLocation: velero-sample-1
42+
----
43+
44+
. Monitor the progress of the `VolumeSnapshotBackup` CRs by completing the following steps:
45+
.. To check the progress of all the `VolumeSnapshotBackup` CRs, run the following command:
46+
+
47+
[source, terminal]
48+
----
49+
$ oc get vsb -n <app_ns>
50+
----
51+
52+
.. To check the progress of a specific `VolumeSnapshotBackup` CR, run the following command:
53+
+
54+
[source,terminal]
55+
----
56+
$ oc get vsb <vsb_name> -n <app_ns> -ojsonpath="{.status.phase}`
57+
----
58+
59+
. Wait several minutes until the `VolumeSnapshotBackup` CR has the status `Completed`.
60+
. 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>`.
61+
62+
ifeval::["{context}" == "cephfs"]
63+
:!cephfs:
64+
endif::[]
65+
ifeval::["{context}" == "split"]
66+
:!split:
67+
endif::[]

modules/oadp-ceph-cephfs-restore.adoc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
ifeval::["{context}" == "cephfs"]
6+
:cephfs:
7+
endif::[]
8+
ifeval::["{context}" == "split"]
9+
:split:
10+
endif::[]
11+
12+
:_content-type: PROCEDURE
13+
[id="oadp-ceph-cephfs-restore_{context}"]
14+
15+
ifdef::cephfs[]
16+
= Restoring data using OADP 1.2 Data Mover and CephFS storage
17+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to restore data using CephFS storage if the shallow copy feature of CephFS storage was enabled for the back up procedure. The shallow copy feature is not used in the restore procedure.
18+
endif::cephfs[]
19+
20+
ifdef::split[]
21+
= Restoring data using OADP 1.2 Data Mover and split volumes
22+
You can use OpenShift API for Data Protection (OADP) 1.2 Data Mover to restore data in an environment that has split volumes, if the shallow copy feature of CephFS storage was enabled for the back up procedure. The shallow copy feature is not used in the restore procedure.
23+
endif::split[]
24+
25+
.Procedure
26+
27+
. Delete the application namespace by running the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc delete vsb -n <app_namespace> --all
32+
----
33+
34+
. Delete any `VolumeSnapshotContent` CRs that were created during backup by running the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc delete volumesnapshotcontent --all
39+
----
40+
41+
. Create a `Restore` CR as in the following example:
42+
+
43+
.Example `Restore` CR
44+
+
45+
[source,yaml]
46+
----
47+
apiVersion: velero.io/v1
48+
kind: Restore
49+
metadata:
50+
name: <restore_name>
51+
namespace: <protected_ns>
52+
spec:
53+
backupName: <previous_backup_name>
54+
----
55+
56+
. Monitor the progress of the `VolumeSnapshotRestore` CRs by doing the following:
57+
.. To check the progress of all the `VolumeSnapshotRestore` CRs, run the following command:
58+
+
59+
[source, terminal]
60+
----
61+
$ oc get vsr -n <app_ns>
62+
----
63+
64+
.. To check the progress of a specific `VolumeSnapshotRestore` CR, run the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ oc get vsr <vsr_name> -n <app_ns> -ojsonpath="{.status.phase}
69+
----
70+
71+
. Verify that your application data has been restored by running the following command:
72+
+
73+
[source,terminal]
74+
----
75+
$ oc get route <route_name> -n <app_ns> -ojsonpath="{.spec.host}"
76+
----
77+
78+
ifeval::["{context}" == "cephfs"]
79+
:!cephfs:
80+
endif::[]
81+
ifeval::["{context}" == "split"]
82+
:!split:
83+
endif::[]

0 commit comments

Comments
 (0)