mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
61 lines
2.3 KiB
Plaintext
61 lines
2.3 KiB
Plaintext
// Module included in the following assembly:
|
|
//
|
|
// * virt/storage/virt-automatic-bootsource-updates.adoc
|
|
//
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="virt-autoupdate-custom-bootsource_{context}"]
|
|
= Enabling automatic updates for custom boot sources
|
|
|
|
[role="_abstract"]
|
|
{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).
|
|
|
|
.Prerequisites
|
|
|
|
* The cluster has a default storage class.
|
|
* You have installed the {oc-first}.
|
|
|
|
.Procedure
|
|
|
|
. Open the `HyperConverged` CR in your default editor by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
|
|
----
|
|
|
|
. Edit the `HyperConverged` CR, adding the appropriate template and boot source in the `dataImportCronTemplates` section. For example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: hco.kubevirt.io/v1beta1
|
|
kind: HyperConverged
|
|
metadata:
|
|
name: kubevirt-hyperconverged
|
|
spec:
|
|
dataImportCronTemplates:
|
|
- metadata:
|
|
name: centos-stream9-image-cron
|
|
annotations:
|
|
cdi.kubevirt.io/storage.bind.immediate.requested: "true" <1>
|
|
spec:
|
|
schedule: "0 */12 * * *" <2>
|
|
template:
|
|
spec:
|
|
source:
|
|
registry: <3>
|
|
url: docker://quay.io/containerdisks/centos-stream:9
|
|
storage:
|
|
resources:
|
|
requests:
|
|
storage: 30Gi
|
|
garbageCollect: Outdated
|
|
managedDataSource: centos-stream9 <4>
|
|
----
|
|
<1> This annotation is required for storage classes with `volumeBindingMode` set to `WaitForFirstConsumer`.
|
|
<2> Schedule for the job specified in cron format.
|
|
<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.
|
|
<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.
|
|
|
|
. Save the file.
|