// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc

:_mod-docs-content-type: PROCEDURE
[id="hcp-dr-oadp-dpa-bm_{context}"]
= Creating a Data Protection Application for bare metal

[role="_abstract"]
Automate parts of the backup and restore process on bare metal by creating a Data Protection Application (DPA). A DPA defines information including backup locations and Velero pod configurations.

You can create a DPA by defining a `DataProtectionApplication` object.

.Procedure

. Create a manifest file similar to the following example:
+
[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: dpa-sample
  namespace: openshift-adp
spec:
  backupLocations:
    - name: default
      velero:
        provider: aws
        default: true
        objectStorage:
          bucket: <bucket_name>
          prefix: <bucket_prefix>
        config:
          region: minio
          profile: "default"
          s3ForcePathStyle: "true"
          s3Url: "<bucket_url>"
          insecureSkipTLSVerify: "true"
        credential:
          key: cloud
          name: cloud-credentials
          default: true
  snapshotLocations:
    - velero:
        provider: aws
        config:
          region: minio
          profile: "default"
        credential:
          key: cloud
          name: cloud-credentials
  configuration:
    nodeAgent:
      enable: true
      uploaderType: kopia
    velero:
      defaultPlugins:
        - openshift
        - aws
        - csi
        - hypershift
      resourceTimeout: 2h
----
+
** `spec.backupLocations.velero.provider` specifies the provider for Velero. If you are using bare metal and MinIO, you can use `aws` as the provider.
** `spec.backupLocations.velero.objectStorage.bucket` specifies the bucket name; for example, `oadp-backup`.
** `spec.backupLocations.velero.objectStorage.prefix` specifies the bucket prefix; for example, `hcp`.
** `spec.backupLocations.velero.config.region` specifies the bucket region. In this example, the region is `minio`, which is a storage provider that is compatible with the S3 API.
** `spec.backupLocations.velero.config.s3Url` specifies the URL of the S3 endpoint.
** `spec.snapshotLocations.velero.provider` specifies the provider for Velero. If you are using bare metal and MinIO, you can use `aws` as the provider.
** `spec.snapshotLocations.velero.config.region` specifies the region. In this example, the region is `minio`, which is a storage provider that is compatible with the S3 API.
** `spec.configuration.nodeAgent.uploaderType` specifies `kopia` as the uploader type. The `restic` uploader type is deprecated for {oadp-short} 1.5 and later.

. Create the DPA object by running the following command:
+
[source,terminal]
----
$ oc create -f dpa.yaml
----
+
After you create the `DataProtectionApplication` object, new `velero` deployment and `node-agent` pods are created in the `openshift-adp` namespace.

.Next steps

* Back up the data plane workload.