Skip to content

Commit e2cad46

Browse files
authored
Merge pull request #59623 from ousleyp/cnv-25648
CNV-25648: boot source doc improvements
2 parents 1ef9bb2 + 4212797 commit e2cad46

16 files changed

+238
-177
lines changed

_topic_maps/_topic_map.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3710,8 +3710,6 @@ Topics:
37103710
File: virt-configuring-vgpu-passthrough
37113711
- Name: Configuring mediated devices
37123712
File: virt-configuring-mediated-devices
3713-
- Name: Automatic importing and updating of pre-defined boot sources
3714-
File: virt-automatic-bootsource-updates
37153713
- Name: Enabling descheduler evictions on virtual machines
37163714
File: virt-enabling-descheduler-evictions
37173715
# Importing virtual machines
@@ -3790,8 +3788,6 @@ Topics:
37903788
File: virt-expanding-virtual-storage-with-blank-disk-images
37913789
- Name: Cloning a data volume using smart-cloning
37923790
File: virt-cloning-a-datavolume-using-smart-cloning
3793-
- Name: Creating and using boot sources
3794-
File: virt-creating-and-using-boot-sources
37953791
- Name: Hot plugging virtual disks
37963792
File: virt-hot-plugging-virtual-disks
37973793
- Name: Using container disks with virtual machines
@@ -3816,6 +3812,11 @@ Topics:
38163812
File: virt-deploying-vm-template-to-custom-namespace
38173813
- Name: Deleting a virtual machine template
38183814
File: virt-deleting-vm-template
3815+
- Name: Creating and using boot sources
3816+
File: virt-creating-and-using-boot-sources
3817+
- Name: Managing automatic boot source updates
3818+
File: virt-automatic-bootsource-updates
3819+
Distros: openshift-enterprise
38193820
# Virtual machine live migration
38203821
- Name: Live migration
38213822
Dir: live_migration
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assembly:
2+
//
3+
// * virt/vm_templates/virt-automatic-bootsource-updates.adoc
4+
//
5+
6+
:_content-type: CONCEPT
7+
[id="virt-about-auto-bootsource-updates_{context}"]
8+
= About automatic boot source updates
9+
10+
Boot sources can make virtual machine (VM) creation more accessible and efficient for users. If automatic boot source updates are enabled, the Containerized Data Importer (CDI) imports, polls, and updates the images so that they are ready to be cloned for new VMs. By default, CDI automatically updates the _system-defined_ boot sources that {VirtProductName} provides.
11+
12+
You can opt out of automatic updates for all system-defined boot sources by disabling the `enableCommonBootImageImport` feature gate. If you disable this feature gate, all `DataImportCron` objects are deleted. This does not remove previously imported `PersistentVolumeClaim` (PVC) objects that store operating system images, though administrators can delete them manually.
13+
14+
When the `enableCommonBootImageImport` feature gate is disabled, `DataSource` objects are reset so that they no longer point to the original PVCs. An administrator can manually provide a boot source by creating a new PVC for the `DataSource` object and populating the PVC with an operating system image.
15+
16+
_Custom_ boot sources that are not provided by {VirtProductName} are not controlled by the feature gate. You must manage them individually by editing the `HyperConverged` custom resource (CR). You can also use this method to manage individual system-defined boot sources.

modules/virt-adding-a-boot-source-web.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ There are four methods for selecting and adding a boot source in the web console
3232
. Click the options menu beside a template and select *Edit boot source*.
3333
. Click *Add disk*.
3434
. In the *Add disk* window, select *Use this disk as a boot source*.
35-
. Enter the disk name and select a *Source*, for example, *Blank (creates PVC)* or *Use an existing PVC*.
35+
. Enter the disk name and select a *Source*, for example, *Blank (creates PVC)*.
3636
. Enter a value for *Persistent Volume Claim size* to specify the PVC size that is adequate for the uncompressed image and any additional space that is required.
37-
. Select a *Type*, for example, *Disk* or *CD-ROM*.
37+
. Select a *Type*, for example, *Disk*.
3838
. Optional: Click *Storage class* and select the storage class that is used to create the disk. Typically, this storage class is the default storage class that is created for use by all PVCs.
3939
+
4040
[NOTE]

modules/virt-autoupdate-custom-bootsource.adoc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
// Module included in the following assembly:
22
//
3-
// * virt/virtual_machines/advanced_vm_management/virt-automatic-bootsource-updates.adoc
3+
// * virt/vm_templates/virt-automatic-bootsource-updates.adoc
44
//
55

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

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).
10+
{VirtProductName} automatically updates system-defined boot sources by default, but does not automatically update custom boot sources. You must manually enable automatic updates by editing the `HyperConverged` custom resource (CR).
11+
12+
.Prerequisites
13+
14+
* The cluster has a default storage class.
1115
1216
.Procedure
1317

14-
. Use the following command to open the `HyperConverged` CR for editing:
18+
. Open the `HyperConverged` CR in your default editor by running the following command:
1519
+
1620
[source,terminal]
1721
----
18-
$ oc edit -n openshift-cnv HyperConverged
22+
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
1923
----
2024

2125
. Edit the `HyperConverged` CR, adding the appropriate template and boot source in the `dataImportCronTemplates` section. For example:
2226
+
23-
.Example in CentOS 7
27+
.Example custom resource
2428
[source,yaml]
2529
----
2630
apiVersion: hco.kubevirt.io/v1beta1
@@ -52,3 +56,5 @@ spec:
5256
<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.
5357
<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.
5458
<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.
59+
60+
. Save the file.
Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
// Module included in the following assembly:
22
//
3-
// * virt/virtual_machines/advanced_vm_management/virt-automatic-bootsource-updates.adoc
3+
// * virt/vm_templates/virt-automatic-bootsource-updates.adoc
44
//
55

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

10-
You can configure a storage class that allows automatic importing and updating for user-defined boot sources.
10+
Specify a new default storage class in the `HyperConverged` custom resource (CR).
11+
12+
[IMPORTANT]
13+
====
14+
Boot sources are created from storage using the default storage class. If your cluster does not have a default storage class, you must define one before configuring automatic updates for custom boot sources.
15+
====
1116

1217
.Procedure
1318

14-
. Define a new `storageClassName` by editing the `HyperConverged` custom resource (CR).
19+
. Open the `HyperConverged` CR in your default editor by running the following command:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc edit hco -n openshift-cnv kubevirt-hyperconverged
24+
----
25+
26+
. Define a new storage class by entering a value in the `storageClassName` field:
1527
+
1628
[source,yaml]
1729
----
@@ -26,17 +38,42 @@ spec:
2638
spec:
2739
template:
2840
spec:
29-
storageClassName: <appropriate_class_name>
30-
# ...
41+
storageClassName: <new_storage_class> <1>
42+
#...
3143
----
32-
. Set the new default storage class by running the following commands:
44+
<1> Define the storage class.
45+
46+
. Remove the `storageclass.kubernetes.io/is-default-class` annotation from the current default storage class.
47+
.. Retrieve the name of the current default storage class by running the following command:
3348
+
3449
[source,terminal]
3550
----
36-
$ oc patch storageclass <current_default_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
51+
$ oc get sc
52+
----
53+
+
54+
.Example output
55+
[source,text]
3756
----
57+
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
58+
csi-manila-ceph manila.csi.openstack.org Delete Immediate false 11d
59+
hostpath-csi-basic (default) kubevirt.io.hostpath-provisioner Delete WaitForFirstConsumer false 11d <1>
60+
...
61+
----
62+
+
63+
<1> In this example, the current default storage class is named `hostpath-csi-basic`.
64+
65+
.. Remove the annotation from the current default storage class by running the following command:
66+
+
67+
[source,terminal]
68+
----
69+
$ oc patch storageclass <current_default_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}' <1>
70+
----
71+
<1> Replace `<current_default_storage_class>` with the `storageClassName` value of the default storage class.
72+
73+
. Set the new storage class as the default by running the following command:
3874
+
3975
[source,terminal]
4076
----
41-
$ oc patch storageclass <appropriate_storage_class> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
77+
$ oc patch storageclass <new_storage_class> -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' <1>
4278
----
79+
<1> Replace `<new_storage_class>` with the `storageClassName` value that you added to the `HyperConverged` CR.
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/vm_templates/virt-automatic-bootsource-updates.adoc
4+
//
5+
6+
:_content-type: PROCEDURE
7+
[id="virt-disable-auto-updates-single-boot-source_{context}"]
8+
= Disabling automatic updates for a single boot source
9+
10+
You can disable automatic updates for an individual boot source, whether it is custom or system-defined, by editing the `HyperConverged` custom resource (CR).
11+
12+
.Procedure
13+
14+
. Open the `HyperConverged` CR in your default editor by running the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
19+
----
20+
21+
. Disable automatic updates for an individual boot source by editing the `spec.dataImportCronTemplates` field.
22+
+
23+
Custom boot source::
24+
* Remove the boot source from the `spec.dataImportCronTemplates` field. Automatic updates are disabled for custom boot sources by default.
25+
26+
+
27+
System-defined boot source::
28+
.. Add the boot source to `spec.dataImportCronTemplates`.
29+
+
30+
[NOTE]
31+
====
32+
Automatic updates are enabled by default for system-defined boot sources, but these boot sources are not listed in the CR unless you add them.
33+
====
34+
.. Set the value of the `dataimportcrontemplate.kubevirt.io/enable` annotation to `false`.
35+
+
36+
--
37+
For example:
38+
[source,yaml]
39+
----
40+
apiVersion: hco.kubevirt.io/v1beta1
41+
kind: HyperConverged
42+
metadata:
43+
name: kubevirt-hyperconverged
44+
spec:
45+
dataImportCronTemplates:
46+
- metadata:
47+
annotations:
48+
dataimportcrontemplate.kubevirt.io/enable: false
49+
name: rhel8-image-cron
50+
# ...
51+
----
52+
--
53+
54+
. Save the file.

modules/virt-disable-bootsource-update.adoc

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

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

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

modules/virt-enabling-bootsource-update.adoc

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assembly:
2+
//
3+
// * virt/vm_templates/virt-automatic-bootsource-updates.adoc
4+
//
5+
6+
:_content-type: PROCEDURE
7+
[id="virt-managing-auto-update-all-system-boot-sources_{context}"]
8+
= Managing automatic updates for all system-defined boot sources
9+
10+
Disabling automatic boot source imports and updates can lower resource usage. In disconnected environments, disabling automatic boot source updates prevents `CDIDataImportCronOutdated` alerts from filling up logs.
11+
12+
To disable automatic updates for all system-defined boot sources, turn off the `enableCommonBootImageImport` feature gate by setting the value to `false`. Setting this value to `true` re-enables the feature gate and turns automatic updates back on.
13+
14+
[NOTE]
15+
====
16+
Custom boot sources are not affected by this setting.
17+
====
18+
19+
.Procedure
20+
21+
* Toggle the feature gate for automatic boot source updates by editing the `HyperConverged` custom resource (CR).
22+
23+
** To disable automatic boot source updates, set the `spec.featureGates.enableCommonBootImageImport` field in the `HyperConverged` CR to `false`. For example:
24+
+
25+
[source,terminal]
26+
----
27+
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv \
28+
--type json -p '[{"op": "replace", "path": \
29+
"/spec/featureGates/enableCommonBootImageImport", \
30+
"value": false}]'
31+
----
32+
33+
** To re-enable automatic boot source updates, set the `spec.featureGates.enableCommonBootImageImport` field in the `HyperConverged` CR to `true`. For example:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc patch hco kubevirt-hyperconverged -n openshift-cnv \
38+
--type json -p '[{"op": "replace", "path": \
39+
"/spec/featureGates/enableCommonBootImageImport", \
40+
"value": true}]'
41+
----

0 commit comments

Comments
 (0)