Skip to content

Commit 01f7355

Browse files
authored
Merge pull request #112212 from Vaishali-gif-rh/CNV-62146
CNV-62146: Boot source garbage collection configuration
2 parents 6070127 + 82b491d commit 01f7355

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt-increasing-bootsource-disk-image-retention.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-increasing-bootsource-disk-image-retention_{context}"]
7+
= Increasing boot source disk image retention
8+
9+
[role="_abstract"]
10+
You can configure image retention settings to increase the number of older operating system image versions preserved on the cluster.
11+
12+
When automatic boot source updates are enabled, the Containerized Data Importer (CDI) tracks and downloads the latest versions of operating system images. By default, the system aggressively minimizes the retention of older versions to conserve disk space. However, if you require a safety mechanism that allows you to roll back if a newly imported version introduces issues, you can increase the retention count.
13+
14+
[NOTE]
15+
====
16+
Manually deleting older `PersistentVolumeClaim` or `DataVolume` objects associated with historic boot source imports does not impact cluster stability or future updates.
17+
====
18+
19+
.Procedure
20+
21+
. Open the `HyperConverged` custom resource (CR) in your default editor:
22+
+
23+
[source,terminal]
24+
----
25+
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
26+
----
27+
28+
. Edit the `spec.dataImportCronTemplates` field to adjust the `importsToKeep` parameter to your preferred retention threshold:
29+
+
30+
[source,yaml]
31+
----
32+
apiVersion: hco.kubevirt.io/v1beta1
33+
kind: HyperConverged
34+
metadata:
35+
name: kubevirt-hyperconverged
36+
spec:
37+
dataImportCronTemplates:
38+
- metadata:
39+
name: rhel9-image-cron
40+
spec:
41+
garbageCollect: Outdated <1>
42+
importsToKeep: 3
43+
schedule: "0 */12 * * *"
44+
managedDataSource: rhel9
45+
----

virt/storage/virt-automatic-bootsource-updates.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ include::modules/virt-enabling-volume-snapshot-boot-source.adoc[leveloffset=+1]
2121

2222
include::modules/virt-disable-auto-updates-single-boot-source.adoc[leveloffset=+1]
2323

24+
include::modules/virt-increasing-bootsource-disk-image-retention.adoc[leveloffset=+1]
25+
2426
include::modules/virt-verify-status-bootsource-update.adoc[leveloffset=+1]
2527

2628
[role="_additional-resources"]

0 commit comments

Comments
 (0)