Skip to content

Commit 943a4a9

Browse files
Matthew Garrellsabrinajess
authored andcommitted
new content and updates
1 parent a386ac6 commit 943a4a9

File tree

6 files changed

+135
-0
lines changed

6 files changed

+135
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,6 +3134,8 @@ Topics:
31343134
File: virt-configuring-mediated-devices
31353135
- Name: Configuring a watchdog device
31363136
File: virt-configuring-a-watchdog
3137+
- Name: Automatic importing and updating of pre-defined boot sources
3138+
File: virt-automatic-bootsource-updates
31373139
- Name: Enabling descheduler evictions on virtual machines
31383140
File: virt-enabling-descheduler-evictions
31393141
# Importing virtual machines
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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-autoupdate-custom-bootsource_{context}"]
8+
= Enabling automatic updates on custom boot sources
9+
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).
11+
12+
.Procedure
13+
14+
. Use the following command to open the `HyperConverged` CR for editing:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc edit -n openshift-cnv HyperConverged
19+
----
20+
21+
. Edit the `HyperConverged` CR, specifying the appropriate template and boot source in the `dataImportCronTemplates` section. For example:
22+
+
23+
.Example in CentOS 7
24+
[source,yaml]
25+
----
26+
apiVersion: hco.kubevirt.io/v1beta1
27+
kind: HyperConverged
28+
metadata:
29+
name: kubevirt-hyperconverged
30+
spec:
31+
dataImportCronTemplates:
32+
- metadata:
33+
name: centos7-image-cron
34+
annotations:
35+
cdi.kubevirt.io/storage.bind.immediate.requested: "true" <1>
36+
spec:
37+
schedule: "0 */12 * * *" <2>
38+
template:
39+
spec:
40+
source:
41+
registry: <3>
42+
url: docker://quay.io/containerdisks/centos:7-2009
43+
storage:
44+
resources:
45+
requests:
46+
storage: 10Gi
47+
managedDataSource: centos7 <4>
48+
retentionPolicy: "None" <5>
49+
----
50+
<1> This annotation is required for storage classes with `volumeBindingMode` set to `WaitForFirstConsumer`.
51+
<2> Schedule for the job specified in cron format.
52+
<3> Use to create a data volume from a registry source. Use the default `pod` `pullMethod` and not `node` `pullMethod`, which is based on the `node` docker cache. The `node` docker cache is useful when a registry image is available via `Container.Image`, but the CDI importer is not authorized to access it.
53+
<4> For the custom image to be detected as an available boot source, the name of the image's `managedDataSource` must match the name of the template's `DataSource`, which is found under `spec.dataVolumeTemplates.spec.sourceRef.name` in the VM template YAML file.
54+
<5> Use `All` to retain data volumes and data sources when the cron job is deleted. Use `None` to delete data volumes and data sources when the cron job is deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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-disabling-bootsource-update_{context}"]
8+
= Disabling automatic boot source updates
9+
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`.
11+
12+
[NOTE]
13+
====
14+
Custom boot sources are not affected by this setting.
15+
====
16+
17+
.Procedure
18+
19+
* Use the following command to disable automatic updates:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op": "replace", "path": "/spec/featureGates/enableCommonBootImageImport", "value": false}]'
24+
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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-enabling-bootsource-update_{context}"]
8+
= Enabling automatic boot source updates
9+
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.
11+
12+
.Procedure
13+
14+
* Use the following command to apply the `dataImportCron` label to the data source:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc label --overwrite DataSource rhel8 -n openshift-virtualization-os-images cdi.kubevirt.io/dataImportCron=true
19+
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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-reenabling-bootsource-update_{context}"]
8+
= Re-enabling automatic boot source updates
9+
10+
If you have previously disabled automatic boot source updates, you must manually re-enable the feature. Set the `spec.featureGates.enableCommonBootImageImport` field in the `HyperConverged` custom resource (CR) to `true`.
11+
12+
.Procedure
13+
14+
* Use the following command to re-enable automatic updates:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op": "replace", "path": "/spec/featureGates/enableCommonBootImageImport", "value": true}]'
19+
----
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:_content-type: ASSEMBLY
2+
[id="virt-automatic-bootsource-updates"]
3+
= Automatic importing and updating of pre-defined boot sources
4+
include::_attributes/virt-document-attributes.adoc[]
5+
:context: virt-automatic-bootsource-updates
6+
7+
toc::[]
8+
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.
10+
11+
include::modules/virt-enabling-bootsource-update.adoc[leveloffset=+1]
12+
13+
include::modules/virt-disable-bootsource-update.adoc[leveloffset=+1]
14+
15+
include::modules/virt-reenabling-bootsource-update.adoc[leveloffset=+1]
16+
17+
include::modules/virt-autoupdate-custom-bootsource.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)