diff --git a/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc b/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc index 8a6d10d94e08..11d36d6a8a63 100644 --- a/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc +++ b/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc @@ -25,5 +25,12 @@ You can schedule backups by creating a xref:../../../backup_and_restore/applicat include::modules/oadp-creating-backup-cr.adoc[leveloffset=+1] include::modules/oadp-backing-up-pvs-csi.adoc[leveloffset=+1] include::modules/oadp-backing-up-applications-restic.adoc[leveloffset=+1] +include::modules/oadp-using-data-mover-for-csi-snapshots.adoc[leveloffset=+1] + +[role="_additional-resources"] +.Additional resources +* xref:../../../operators/admin/olm-adding-operators-to-cluster.adoc#olm-installing-operators-from-operatorhub_olm-adding-operators-to-a-cluster[Installing Operators on clusters for administrators] +* xref:../../../operators/user/olm-installing-operators-in-namespace.adoc#olm-installing-operators-in-namespace[Installing Operators in namespaces for non-administrators] + include::modules/oadp-creating-backup-hooks.adoc[leveloffset=+1] include::modules/oadp-scheduling-backups.adoc[leveloffset=+1] diff --git a/modules/oadp-using-data-mover-for-csi-snapshots.adoc b/modules/oadp-using-data-mover-for-csi-snapshots.adoc new file mode 100644 index 000000000000..5aa41713c7ae --- /dev/null +++ b/modules/oadp-using-data-mover-for-csi-snapshots.adoc @@ -0,0 +1,214 @@ +// Module included in the following assemblies: +// +// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc + +:_content-type: PROCEDURE +[id="oadp-using-data-mover-for-csi-snapshots_{context}"] += Using Data Mover for CSI snapshots + +:FeatureName: Data Mover for CSI snapshots +include::snippets/technology-preview.adoc[] + +The OADP 1.1.0 Data Mover enables customers to back up container storage interface (CSI) volume snapshots to a remote object store. When Data Mover is enabled, you can restore stateful applications from the store if a failure, accidental deletion, or corruption of the cluster occurs. The OADP 1.1.0 Data Mover solution uses the Restic option of VolSync. + +[NOTE] +===== +Data Mover supports backup and restore of CSI volume snapshots only. + +Currently, Data Mover does not support Google Cloud Storage (GCS) buckets. +===== + +.Prerequisites + +* You have verified that the `StorageClass` and `VolumeSnapshotClass` custom resources (CRs) support CSI. + +* You have verified that only one `volumeSnapshotClass` CR has the annotation `snapshot.storage.kubernetes.io/is-default-class: true`. + +* You have verified that only one `storageClass` CR has the annotation `storageclass.kubernetes.io/is-default-class: true`. + +* You have included the label `{velero-domain}/csi-volumesnapshot-class: 'true'` in your `VolumeSnapshotClass` CR. + +* You have installed the VolSync Operator by using the Operator Lifecycle Manager (OLM). ++ +[NOTE] +==== +The VolSync Operator is required only for use with the Technology Preview Data Mover. The Operator is not required for using OADP production features. +==== + +* You have installed the OADP operator by using OLM. + +.Procedure + +. Configure a Restic secret by creating a `.yaml` file as following: ++ +[source,yaml] +---- +apiVersion: v1 +kind: Secret +metadata: + name: + namespace: openshift-adp +type: Opaque +stringData: + RESTIC_PASSWORD: +---- ++ +[NOTE] +==== +By default, the Operator looks for a secret named `dm-credential`. If you are using a different name, you need to specify the name through a Data Protection Application (DPA) CR using `dpa.spec.features.dataMover.credentialName`. +==== + +. Create a DPA CR similar to the following example. The default plug-ins include CSI. ++ +.Example Data Protection Application (DPA) CR +[source,yaml] +---- +apiVersion: oadp.openshift.io/v1alpha1 +kind: DataProtectionApplication +metadata: + name: velero-sample + namespace: openshift-adp +spec: + features: + dataMover: + enable: true + credentialName: <1> + backupLocations: + - velero: + config: + profile: default + region: us-east-1 + credential: + key: cloud + name: cloud-credentials + default: true + objectStorage: + bucket: + prefix: + provider: aws + configuration: + restic: + enable: + velero: + defaultPlugins: + - openshift + - aws + - csi +---- +<1> Add the Restic secret name from the previous step. If this is not done, the default secret name `dm-credential` is used. ++ +The OADP Operator installs two custom resource definitions (CRDs), `VolumeSnapshotBackup` and `VolumeSnapshotRestore`. ++ +.Example `VolumeSnapshotBackup` CRD +[source,yaml] +---- +apiVersion: datamover.oadp.openshift.io/v1alpha1 +kind: VolumeSnapshotBackup +metadata: + name: + namespace: <1> +spec: + volumeSnapshotContent: + name: + protectedNamespace: + resticSecretRef: + name: +---- +<1> Specify the namespace where the volume snapshot exists. ++ +.Example `VolumeSnapshotRestore` CRD +[source,yaml] +---- +apiVersion: datamover.oadp.openshift.io/v1alpha1 +kind: VolumeSnapshotRestore +metadata: + name: + namespace: <1> +spec: + protectedNamespace: <2> + resticSecretRef: + name: + volumeSnapshotMoverBackupRef: + sourcePVCData: + name: + size: + resticrepository: + volumeSnapshotClassName: +---- +<1> Specify the namespace where the volume snapshot exists. +<2> Specify the namespace where the Operator is installed. The default is `openshift-adp`. + +. You can back up a volume snapshot by performing the following steps: + +.. Create a backup CR: ++ +[source,yaml] +---- +apiVersion: {velero-domain}/v1 +kind: Backup +metadata: + name: + namespace: <1> +spec: + includedNamespaces: + - + storageLocation: velero-sample-1 +---- +<1> Specify the namespace where the Operator is installed. The default namespace is `openshift-adp`. + +.. Wait up to 10 minutes and check whether the `VolumeSnapshotBackup` CR status is `Completed` by entering the following commands: ++ +[source,terminal] +---- +$ oc get vsb -n +---- ++ +[source,terminal] +---- +$ oc get vsb -n -o jsonpath="{.status.phase}" +---- ++ +A snapshot is created in the object store was configured in the DPA. ++ +[NOTE] +==== +If the status of the `VolumeSnapshotBackup` CR becomes `Failed`, refer to the Velero logs for troubleshooting. +==== + +. You can restore a volume snapshot by performing the following steps: + +.. Delete the application namespace and the `volumeSnapshotContent` that was created by the Velero CSI plug-in. + +.. Create a `Restore` CR and set `restorePVs` to `true`. ++ +.Example `Restore` CR +[source,yaml] +---- +apiVersion: velero.io/v1 +kind: Restore +metadata: + name: + namespace: +spec: + backupName: + restorePVs: true +---- + +.. Wait up to 10 minutes and check whether the `VolumeSnapshotRestore` CR status is `Completed` by entering the following command: ++ +[source,terminal] +---- +$ oc get vsr -n +---- ++ +[source,terminal] +---- +$ oc get vsr -n -o jsonpath="{.status.phase}" +---- + +.. Check whether your application data and resources have been restored. ++ +[NOTE] +==== +If the status of the `VolumeSnapshotRestore` CR becomes 'Failed', refer to the Velero logs for troubleshooting. +====