Skip to content

Commit a698aed

Browse files
authored
Merge pull request #48595 from bgaydosrh/CNV-15737_2
CNV-15737: Corrections to boot source autoupdate assembly
2 parents bee3b7c + 701789d commit a698aed

7 files changed

+121
-22
lines changed

modules/virt-autoupdate-custom-bootsource.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
:_content-type: PROCEDURE
77
[id="virt-autoupdate-custom-bootsource_{context}"]
8-
= Enabling automatic updates on custom boot sources
8+
= Enabling automatic updates for user-defined boot sources
99

10-
{VirtProductName} automatically updates pre-defined boot sources by default, but does not automatically update custom boot sources. You must manually enable automatic imports and updates on any custom boot sources by editing the `HyperConverged` custom resource (CR).
10+
{VirtProductName} automatically updates system-defined boot sources by default, but does not automatically update user-defined boot sources. You must manually enable automatic imports and updates on a user-defined boot sources by editing the `HyperConverged` custom resource (CR).
1111

1212
.Procedure
1313

@@ -18,7 +18,7 @@
1818
$ oc edit -n openshift-cnv HyperConverged
1919
----
2020

21-
. Edit the `HyperConverged` CR, specifying the appropriate template and boot source in the `dataImportCronTemplates` section. For example:
21+
. Edit the `HyperConverged` CR, adding the appropriate template and boot source in the `dataImportCronTemplates` section. For example:
2222
+
2323
.Example in CentOS 7
2424
[source,yaml]

modules/virt-configuring-storage-class-bootsource-update.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
:_content-type: PROCEDURE
77
[id="virt-configuring-storage-class-bootsource-update_{context}"]
8-
= Configuring a storage class for custom boot source updates
8+
= Configuring a storage class for user-defined boot source updates
99

10-
You must configure a storage class that allows automatic updating for custom boot sources.
10+
You can configure a storage class that allows automatic importing and updating for user-defined boot sources.
1111

1212
.Procedure
1313

14-
* Choose the appropriate method to configure a storage class:
15-
** Edit the `HyperConverged` custom resource (CR) and define a `storageClassName`.
14+
. Define a new `storageClassName` by editing the `HyperConverged` custom resource (CR).
1615
+
1716
[source,yaml]
1817
----
@@ -27,17 +26,17 @@ spec:
2726
spec:
2827
template:
2928
spec:
30-
storageClassName: <storage_class_name>
29+
storageClassName: <appropriate_class_name>
3130
...
3231
----
33-
** Set a default storage class by running the following commands:
32+
. Set the new default storage class by running the following commands:
3433
+
3534
[source,terminal]
3635
----
37-
oc patch storageclass <current_default_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
36+
$ oc patch storageclass <current_default_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
3837
----
3938
+
4039
[source,terminal]
4140
----
42-
oc patch storageclass <appropriate_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
41+
$ oc patch storageclass <appropriate_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
4342
----

modules/virt-disable-bootsource-update.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77
[id="virt-disabling-bootsource-update_{context}"]
88
= Disabling automatic boot source updates
99

10-
You can reduce the number of logs on disconnected environments or reduce resource usage by disabling the automatic imports and updates of pre-defined boot sources. Set the `spec.featureGates.enableCommonBootImageImport` field in the `HyperConverged` custom resource (CR) to `false`.
10+
Disabling automatic boot source imports and updates can be helpful to reduce the number of logs in disconnected environments or to reduce resource usage.
11+
12+
To disable automatic boot source imports and updates, set the `spec.featureGates.enableCommonBootImageImport` field in the `HyperConverged` custom resource (CR) to `false`.
1113

1214
[NOTE]
1315
====
14-
Custom boot sources are not affected by this setting.
16+
User-defined boot sources are not affected by this setting.
1517
====
1618

1719
.Procedure
1820

19-
* Use the following command to disable automatic updates:
21+
* Use the following command to disable automatic boot source updates:
2022
+
2123
[source,terminal]
2224
----
23-
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op": "replace", "path": "/spec/featureGates/enableCommonBootImageImport", "value": false}]'
25+
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv \
26+
--type json -p '[{"op": "replace", "path": "/spec/featureGates/enableCommonBootImageImport", \
27+
"value": false}]'
2428
----

modules/virt-disable-individual-bootsource-update.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55

66
:_content-type: PROCEDURE
77
[id="virt-disable-individual-bootsource-update_{context}"]
8-
= Disabling an automatic update for a custom boot source
8+
= Disabling an automatic update for a system-defined or user-defined boot source
99

10-
You can reduce the number of logs on disconnected environments or reduce resource usage by disabling the automatic imports and updates for an individual custom boot source.
10+
You can disable automatic imports and updates for a user-defined boot source and for a system-defined boot source.
11+
12+
Because system-defined boot sources are not listed by default in the `spec.dataImportCronTemplates` of the `HyperConverged` custom resource (CR), you must add the boot source and disable auto imports and updates.
1113

1214
.Procedure
1315

14-
* Edit the `HyperConverged` custom resource (CR) and disable updates for a custom boot source by setting the `dataimportcrontemplate.kubevirt.io/enable` annotation in the CR to `false`.
16+
* To disable automatic imports and updates for a user-defined boot source, remove the boot source from the `spec.dataImportCronTemplates` field in the custom resource list.
17+
* To disable automatic imports and updates for a system-defined boot source:
18+
** Edit the `HyperConverged` CR and add the boot source to `spec.dataImportCronTemplates`.
19+
** Disable automatic imports and updates by setting the `dataimportcrontemplate.kubevirt.io/enable` annotation to `false`. For example:
1520
+
1621
[source,yaml]
1722
----

modules/virt-enabling-bootsource-update.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
[id="virt-enabling-bootsource-update_{context}"]
88
= Enabling automatic boot source updates
99

10-
If you have pre-defined boot sources from {VirtProductName} 4.9, then you must manually opt them in to the automatic boot source updates. All pre-defined boot sources from {VirtProductName} 4.10 and later are automatically updated by default.
10+
If you have boot sources from {VirtProductName} 4.9 or earlier, you must manually turn on automatic updates for these boot sources. All boot sources in {VirtProductName} 4.10 and later are automatically updated by default.
11+
12+
To enable automatic boot source imports and updates, set the `cdi.kubevirt.io/dataImportCron` field to `true` for each boot source you want to update automatically.
1113

1214
.Procedure
1315

14-
* Use the following command to apply the `dataImportCron` label to the data source:
16+
* To turn on automatic updates for a boot source, use the following command to apply the `dataImportCron` label to the data source:
1517
+
1618
[source,terminal]
1719
----
18-
$ oc label --overwrite DataSource rhel8 -n openshift-virtualization-os-images cdi.kubevirt.io/dataImportCron=true
20+
$ oc label --overwrite DataSource rhel8 -n openshift-virtualization-os-images cdi.kubevirt.io/dataImportCron=true <1>
1921
----
22+
<1> Specifying `true` turns on automatic updates for the `rhel8` boot source.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Module included in the following assembly:
2+
//
3+
// * virt/virtual_machines/advanced_vm_management/virt-automatic-bootsource-updates.adoc
4+
//
5+
6+
:_content-type: PROCEDURE
7+
[id="virt-verify-status-bootsource-update_{context}"]
8+
= Verifying the status of a boot source
9+
10+
You can verify whether a boot source is system-defined or user-defined.
11+
12+
The `status` section of each boot source listed in the `status.dataImportChronTemplates` field of the `HyperConverged` CR indicates the type of boot source. For example, `commonTemplate: true` indicates a system-defined (`commonTemplate`) boot source and `status: {}` indicates a user-defined boot source.
13+
14+
.Procedure
15+
16+
. Use the `oc get` command to list the `dataImportChronTemplates` in the `HyperConverged` CR.
17+
18+
. Verify the status of the boot source.
19+
+
20+
.Example output
21+
22+
[source,yaml]
23+
----
24+
...
25+
apiVersion: hco.kubevirt.io/v1beta1
26+
kind: HyperConverged
27+
...
28+
spec:
29+
...
30+
status: <1>
31+
...
32+
dataImportCronTemplates: <2>
33+
- metadata:
34+
annotations:
35+
cdi.kubevirt.io/storage.bind.immediate.requested: "true"
36+
name: centos-7-image-cron
37+
spec:
38+
garbageCollect: Outdated
39+
managedDataSource: centos7
40+
schedule: 55 8/12 * * *
41+
template:
42+
metadata: {}
43+
spec:
44+
source:
45+
registry:
46+
url: docker://quay.io/containerdisks/centos:7-2009
47+
storage:
48+
resources:
49+
requests:
50+
storage: 30Gi
51+
status: {}
52+
status:
53+
commonTemplate: true <3>
54+
...
55+
- metadata:
56+
annotations:
57+
cdi.kubevirt.io/storage.bind.immediate.requested: "true"
58+
name: user-defined-dic
59+
spec:
60+
garbageCollect: Outdated
61+
managedDataSource: user-defined-centos-stream8
62+
schedule: 55 8/12 * * *
63+
template:
64+
metadata: {}
65+
spec:
66+
source:
67+
registry:
68+
pullMethod: node
69+
url: docker://quay.io/containerdisks/centos-stream:8
70+
storage:
71+
resources:
72+
requests:
73+
storage: 30Gi
74+
status: {}
75+
status: {} <4>
76+
...
77+
----
78+
<1> The `status` field for the `HyperConverged` CR.
79+
<2> The `dataImportCronTemplates` field, which lists all defined boot sources.
80+
<3> Indicates a system-defined boot source.
81+
<4> Indicates a user-defined boot source.

virt/virtual_machines/advanced_vm_management/virt-automatic-bootsource-updates.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
As of version 4.10, {VirtProductName} automatically imports and updates pre-defined boot sources, unless you manually opt-out. If you upgrade to version {VirtProductName} 4.10 from version 4.9 or earlier and have pre-defined boot sources from the earlier version, you must manually opt-in to automatic imports and updates for those pre-defined boot sources.
9+
You can use boot sources that are _system-defined_ and included with {VirtProductName} or _user-defined_, which you create. System-defined boot source imports and updates are controlled by the product feature gate. You can enable, disable, or re-enable updates using the feature gate. User-defined boot sources are not controlled by the product feature gate and must be individually managed to opt in or opt out of automatic imports and updates.
10+
11+
[IMPORTANT]
12+
====
13+
As of version 4.10, {VirtProductName} automatically imports and updates boot sources, unless you manually opt out. If you upgrade to version 4.10, you must manually enable automatic imports and updates for boot sources from version 4.9 or earlier.
14+
====
1015

1116
include::modules/virt-enabling-bootsource-update.adoc[leveloffset=+1]
1217

@@ -19,3 +24,5 @@ include::modules/virt-configuring-storage-class-bootsource-update.adoc[leveloffs
1924
include::modules/virt-autoupdate-custom-bootsource.adoc[leveloffset=+1]
2025

2126
include::modules/virt-disable-individual-bootsource-update.adoc[leveloffset=+1]
27+
28+
include::modules/virt-verify-status-bootsource-update.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)