diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index 1cf8afa6babe..785cd2098293 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -3531,7 +3531,7 @@ Topics: - Name: Scheduling backups using Schedule CR File: oadp-scheduling-backups-doc - Name: Deleting backups - File: oadp-deleting-backups-doc + File: oadp-deleting-backups - Name: About Kopia File: oadp-about-kopia - Name: OADP restoring diff --git a/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc b/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc deleted file mode 100644 index c5e5abfefab4..000000000000 --- a/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc +++ /dev/null @@ -1,44 +0,0 @@ -:_mod-docs-content-type: PROCEDURE -[id="oadp-deleting-backups-doc"] -= Deleting backups -include::_attributes/common-attributes.adoc[] -:context: backing-up-applications - -toc::[] - -You can remove backup files by deleting the `Backup` custom resource (CR). - -[WARNING] -==== -After you delete the `Backup` CR and the associated object storage data, you cannot recover the deleted data. -==== - -.Prerequisites - -* You created a `Backup` CR. -* You know the name of the `Backup` CR and the namespace that contains it. -* You downloaded the Velero CLI tool. -* You can access the Velero binary in your cluster. - -.Procedure - -* Choose one of the following actions to delete the `Backup` CR: - -** To delete the `Backup` CR and keep the associated object storage data, run the following command: -+ -[source,terminal] ----- -$ oc delete backup -n ----- - -** To delete the `Backup` CR and delete the associated object storage data, run the following command: -+ -[source,terminal] ----- -$ velero backup delete -n ----- -+ -Where: -+ -:: The name of the `Backup` custom resource. -:: The namespace that contains the `Backup` custom resource. diff --git a/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc b/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc new file mode 100644 index 000000000000..9615b4174040 --- /dev/null +++ b/backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc @@ -0,0 +1,24 @@ +:_mod-docs-content-type: ASSEMBLY +[id="oadp-deleting-backups"] += Deleting backups +include::_attributes/common-attributes.adoc[] +:context: deleting-backups + +toc::[] + +You can delete a backup by creating the `DeleteBackupRequest` custom resource (CR) or by running the `velero backup delete` command as explained in the following procedures. + +The volume backup artifacts are deleted at different times depending on the backup method: + +* Restic: The artifacts are deleted in the next full maintenance cycle, after the backup is deleted. +* Container Storage Interface (CSI): The artifacts are deleted immediately when the backup is deleted. +* Kopia: The artifacts are deleted after three full maintenance cycles of the Kopia repository, after the backup is deleted. + +// delete using oc command +include::modules/oadp-deleting-backups-using-oc.adoc[leveloffset=+1] +// delete using velero +include::modules/oadp-deleting-backups-using-velero.adoc[leveloffset=+1] +// kopia repo maintenance +include::modules/oadp-about-kopia-repo-maintenance.adoc[leveloffset=+1] +// delete backup repository +include::modules/oadp-deleting-backup-repository.adoc[leveloffset=+1] diff --git a/modules/oadp-about-kopia-repo-maintenance.adoc b/modules/oadp-about-kopia-repo-maintenance.adoc new file mode 100644 index 000000000000..9f2c6c045205 --- /dev/null +++ b/modules/oadp-about-kopia-repo-maintenance.adoc @@ -0,0 +1,43 @@ +// Module included in the following assemblies: +// +// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc + + +:_mod-docs-content-type: CONCEPT +[id="oadp-about-kopia-repo-maintenance_{context}"] += About Kopia repository maintenance + +There are two types of Kopia repository maintenance: + +Quick maintenance:: +* Runs every hour to keep the number of index blobs (n) low. A high number of indexes negatively affects the performance of Kopia operations. +* Does not delete any metadata from the repository without ensuring that another copy of the same metadata exists. + +Full maintenance:: +* Runs every 24 hours to perform garbage collection of repository contents that are no longer needed. +* `snapshot-gc`, a full maintenance task, finds all files and directory listings that are no longer accessible from snapshot manifests and marks them as deleted. +* A full maintenance is a resource-costly operation, as it requires scanning all directories in all snapshots that are active in the cluster. + +[id="kopia-maint-in-oadp_{context}"] +== Kopia maintenance in {oadp-short} + +The `repo-maintain-job` jobs are executed in the namespace where {oadp-short} is installed, as shown in the following example: + +[source, terminal] +---- +pod/repo-maintain-job-173...2527-2nbls 0/1 Completed 0 168m +pod/repo-maintain-job-173....536-fl9tm 0/1 Completed 0 108m +pod/repo-maintain-job-173...2545-55ggx 0/1 Completed 0 48m +---- + +You can check the logs of the `repo-maintain-job` for more details about the cleanup and the removal of artifacts in the backup object storage. You can find a note, as shown in the following example, in the `repo-maintain-job` when the next full cycle maintenance is due: + +[source, terminal] +---- +not due for full maintenance cycle until 2024-00-00 18:29:4 +---- + +[IMPORTANT] +==== +Three successful executions of a full maintenance cycle are required for the objects to be deleted from the backup object storage. This means you can expect up to 72 hours for all the artifacts in the backup object storage to be deleted. +==== \ No newline at end of file diff --git a/modules/oadp-deleting-backup-repository.adoc b/modules/oadp-deleting-backup-repository.adoc new file mode 100644 index 000000000000..1839d8971e1c --- /dev/null +++ b/modules/oadp-deleting-backup-repository.adoc @@ -0,0 +1,31 @@ +// Module included in the following assemblies: +// +// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc + +:_mod-docs-content-type: PROCEDURE +[id="oadp-deleting-backup-repository_{context}"] += Deleting a backup repository + +After you delete the backup, and after the Kopia repository maintenance cycles to delete the related artifacts are complete, the backup is no longer referenced by any metadata or manifest objects. You can then delete the `backuprepository` custom resource (CR) to complete the backup deletion process. + +.Prerequisites + +* You have deleted the backup of your application. +* You have waited up to 72 hours after the backup is deleted. This time frame allows Kopia to run the repository maintenance cycles. + +.Procedure + +. To get the name of the backup repository CR for a backup, run the following command: ++ +[source,terminal] +---- +$ oc get backuprepositories.velero.io -n openshift-adp +---- + +. To delete the backup repository CR, run the following command: ++ +[source,terminal] +---- +$ oc delete backuprepository -n openshift-adp <1> +---- +<1> Specify the name of the backup repository from the earlier step. \ No newline at end of file diff --git a/modules/oadp-deleting-backups-using-oc.adoc b/modules/oadp-deleting-backups-using-oc.adoc new file mode 100644 index 000000000000..b8193c8b3c7c --- /dev/null +++ b/modules/oadp-deleting-backups-using-oc.adoc @@ -0,0 +1,37 @@ +// Module included in the following assemblies: +// +// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc + + +:_mod-docs-content-type: PROCEDURE +[id="oadp-deleting-backups-using-oc_{context}"] += Deleting a backup by creating a DeleteBackupRequest CR + +You can delete a backup by creating a `DeleteBackupRequest` custom resource (CR). + +.Prerequisites + +* You have run a backup of your application. + +.Procedure + +. Create a `DeleteBackupRequest` CR manifest file: ++ +[source,yaml] +---- +apiVersion: velero.io/v1 +kind: DeleteBackupRequest +metadata: + name: deletebackuprequest + namespace: openshift-adp +spec: + backupName: # <1> +---- +<1> Specify the name of the backup. + +. Apply the `DeleteBackupRequest` CR to delete the backup: ++ +[source,terminal] +---- +$ oc apply -f +---- \ No newline at end of file diff --git a/modules/oadp-deleting-backups-using-velero.adoc b/modules/oadp-deleting-backups-using-velero.adoc new file mode 100644 index 000000000000..9cfe90d57532 --- /dev/null +++ b/modules/oadp-deleting-backups-using-velero.adoc @@ -0,0 +1,25 @@ +// Module included in the following assemblies: +// +// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc + + +:_mod-docs-content-type: PROCEDURE +[id="oadp-deleting-backups-using-velero_{context}"] += Deleting a backup by using the Velero CLI + +You can delete a backup by using the Velero CLI. + +.Prerequisites + +* You have run a backup of your application. +* You downloaded the Velero CLI and can access the Velero binary in your cluster. + +.Procedure + +* To delete the backup, run the following Velero command: ++ +[source,terminal] +---- +$ velero backup delete -n openshift-adp <1> +---- +<1> Specify the name of the backup. diff --git a/modules/oadp-deleting-backups.adoc b/modules/oadp-deleting-backups.adoc deleted file mode 100644 index 574ad47db1ed..000000000000 --- a/modules/oadp-deleting-backups.adoc +++ /dev/null @@ -1,44 +0,0 @@ -// Module included in the following assemblies: -// -// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc - -:_mod-docs-content-type: PROCEDURE -[id="oadp-deleting-backups_{context}"] -= Deleting backups - -You can remove backup files by deleting the `Backup` custom resource (CR). - -[WARNING] -==== -After you delete the `Backup` CR and the associated object storage data, you cannot recover the deleted data. -==== - -.Prerequisites - -* You created a `Backup` CR. -* You know the name of the `Backup` CR and the namespace that contains it. -* You downloaded the Velero CLI tool. -* You can access the Velero binary in your cluster. - -.Procedure - -* Choose one of the following actions to delete the `Backup` CR: - -** To delete the `Backup` CR and keep the associated object storage data, issue the following command: -+ -[source,terminal] ----- -$ oc delete backup -n ----- - -** To delete the `Backup` CR and delete the associated object storage data, issue the following command: -+ -[source,terminal] ----- -$ velero backup delete -n ----- -+ -Where: -+ -:: Specifies the name of the `Backup` custom resource. -:: Specifies the namespace that contains the `Backup` custom resource. \ No newline at end of file