Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _topic_maps/_topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3384,7 +3384,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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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]
43 changes: 43 additions & 0 deletions modules/oadp-about-kopia-repo-maintenance.adoc
Original file line number Diff line number Diff line change
@@ -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.
====
31 changes: 31 additions & 0 deletions modules/oadp-deleting-backup-repository.adoc
Original file line number Diff line number Diff line change
@@ -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 <backup_repository_name> -n openshift-adp <1>
----
<1> Specify the name of the backup repository from the earlier step.
37 changes: 37 additions & 0 deletions modules/oadp-deleting-backups-using-oc.adoc
Original file line number Diff line number Diff line change
@@ -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: <backup_name> # <1>
----
<1> Specify the name of the backup.

. Apply the `DeleteBackupRequest` CR to delete the backup:
+
[source,terminal]
----
$ oc apply -f <deletebackuprequest_cr_filename>
----
25 changes: 25 additions & 0 deletions modules/oadp-deleting-backups-using-velero.adoc
Original file line number Diff line number Diff line change
@@ -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 <backup_name> -n openshift-adp <1>
----
<1> Specify the name of the backup.
44 changes: 0 additions & 44 deletions modules/oadp-deleting-backups.adoc

This file was deleted.