Skip to content

Commit 73dc246

Browse files
Merge pull request #85264 from shdeshpa07/OADP-5010-Delete-Backups
OADP-5010 delete backups
2 parents ae0a873 + d084c78 commit 73dc246

File tree

8 files changed

+161
-89
lines changed

8 files changed

+161
-89
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3539,7 +3539,7 @@ Topics:
35393539
- Name: Scheduling backups using Schedule CR
35403540
File: oadp-scheduling-backups-doc
35413541
- Name: Deleting backups
3542-
File: oadp-deleting-backups-doc
3542+
File: oadp-deleting-backups
35433543
- Name: About Kopia
35443544
File: oadp-about-kopia
35453545
- Name: OADP restoring

backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="oadp-deleting-backups"]
3+
= Deleting backups
4+
include::_attributes/common-attributes.adoc[]
5+
:context: deleting-backups
6+
7+
toc::[]
8+
9+
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.
10+
11+
The volume backup artifacts are deleted at different times depending on the backup method:
12+
13+
* Restic: The artifacts are deleted in the next full maintenance cycle, after the backup is deleted.
14+
* Container Storage Interface (CSI): The artifacts are deleted immediately when the backup is deleted.
15+
* Kopia: The artifacts are deleted after three full maintenance cycles of the Kopia repository, after the backup is deleted.
16+
17+
// delete using oc command
18+
include::modules/oadp-deleting-backups-using-oc.adoc[leveloffset=+1]
19+
// delete using velero
20+
include::modules/oadp-deleting-backups-using-velero.adoc[leveloffset=+1]
21+
// kopia repo maintenance
22+
include::modules/oadp-about-kopia-repo-maintenance.adoc[leveloffset=+1]
23+
// delete backup repository
24+
include::modules/oadp-deleting-backup-repository.adoc[leveloffset=+1]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc
4+
5+
6+
:_mod-docs-content-type: CONCEPT
7+
[id="oadp-about-kopia-repo-maintenance_{context}"]
8+
= About Kopia repository maintenance
9+
10+
There are two types of Kopia repository maintenance:
11+
12+
Quick maintenance::
13+
* Runs every hour to keep the number of index blobs (n) low. A high number of indexes negatively affects the performance of Kopia operations.
14+
* Does not delete any metadata from the repository without ensuring that another copy of the same metadata exists.
15+
16+
Full maintenance::
17+
* Runs every 24 hours to perform garbage collection of repository contents that are no longer needed.
18+
* `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.
19+
* A full maintenance is a resource-costly operation, as it requires scanning all directories in all snapshots that are active in the cluster.
20+
21+
[id="kopia-maint-in-oadp_{context}"]
22+
== Kopia maintenance in {oadp-short}
23+
24+
The `repo-maintain-job` jobs are executed in the namespace where {oadp-short} is installed, as shown in the following example:
25+
26+
[source, terminal]
27+
----
28+
pod/repo-maintain-job-173...2527-2nbls 0/1 Completed 0 168m
29+
pod/repo-maintain-job-173....536-fl9tm 0/1 Completed 0 108m
30+
pod/repo-maintain-job-173...2545-55ggx 0/1 Completed 0 48m
31+
----
32+
33+
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:
34+
35+
[source, terminal]
36+
----
37+
not due for full maintenance cycle until 2024-00-00 18:29:4
38+
----
39+
40+
[IMPORTANT]
41+
====
42+
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.
43+
====
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups-doc.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="oadp-deleting-backup-repository_{context}"]
7+
= Deleting a backup repository
8+
9+
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.
10+
11+
.Prerequisites
12+
13+
* You have deleted the backup of your application.
14+
* You have waited up to 72 hours after the backup is deleted. This time frame allows Kopia to run the repository maintenance cycles.
15+
16+
.Procedure
17+
18+
. To get the name of the backup repository CR for a backup, run the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc get backuprepositories.velero.io -n openshift-adp
23+
----
24+
25+
. To delete the backup repository CR, run the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc delete backuprepository <backup_repository_name> -n openshift-adp <1>
30+
----
31+
<1> Specify the name of the backup repository from the earlier step.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc
4+
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="oadp-deleting-backups-using-oc_{context}"]
8+
= Deleting a backup by creating a DeleteBackupRequest CR
9+
10+
You can delete a backup by creating a `DeleteBackupRequest` custom resource (CR).
11+
12+
.Prerequisites
13+
14+
* You have run a backup of your application.
15+
16+
.Procedure
17+
18+
. Create a `DeleteBackupRequest` CR manifest file:
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: velero.io/v1
23+
kind: DeleteBackupRequest
24+
metadata:
25+
name: deletebackuprequest
26+
namespace: openshift-adp
27+
spec:
28+
backupName: <backup_name> # <1>
29+
----
30+
<1> Specify the name of the backup.
31+
32+
. Apply the `DeleteBackupRequest` CR to delete the backup:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc apply -f <deletebackuprequest_cr_filename>
37+
----
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-deleting-backups.adoc
4+
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="oadp-deleting-backups-using-velero_{context}"]
8+
= Deleting a backup by using the Velero CLI
9+
10+
You can delete a backup by using the Velero CLI.
11+
12+
.Prerequisites
13+
14+
* You have run a backup of your application.
15+
* You downloaded the Velero CLI and can access the Velero binary in your cluster.
16+
17+
.Procedure
18+
19+
* To delete the backup, run the following Velero command:
20+
+
21+
[source,terminal]
22+
----
23+
$ velero backup delete <backup_name> -n openshift-adp <1>
24+
----
25+
<1> Specify the name of the backup.

modules/oadp-deleting-backups.adoc

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)