Skip to content

Commit e4394f0

Browse files
committed
CNV-10283: CDI customizations in HCO
1 parent 3a58864 commit e4394f0

13 files changed

+91
-101
lines changed

modules/virt-about-cpu-and-memory-quota-namespace.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
A _resource quota_, defined by the `ResourceQuota` object, imposes restrictions on a namespace that limit the total amount of compute resources that can be consumed by resources within that namespace.
99

10-
The `CDI` object defines the user configuration for the Containerized Data Importer (CDI). The CPU and memory request and limit values for the `CDI` object are set to a default value of 0.
10+
The `HyperConverged` custom resource (CR) defines the user configuration for the Containerized Data Importer (CDI). The CPU and memory request and limit values are set to a default value of `0`.
1111
This ensures that pods created by CDI that do not specify compute resource requirements are given the default values and are allowed to run in a namespace that is restricted with a quota.

modules/virt-defining-storageclass-in-cdi.adoc

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc
4+
5+
[id="virt-defining-storageclass_{context}"]
6+
= Defining a storage class
7+
8+
You can define the storage class that the Containerized Data Importer (CDI) uses when allocating scratch space by adding the `spec.scratchSpaceStorageClass` field to the `HyperConverged` custom resource (CR).
9+
10+
.Prerequisites
11+
12+
* Install the OpenShift client (`oc`).
13+
14+
.Procedure
15+
16+
. Edit the `HyperConverged` CR by running the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ oc edit hco -n openshift-cnv kubevirt-hyperconverged
21+
----
22+
23+
. Add the `spec.scratchSpaceStorageClass` field to the CR, setting the value to the name of a storage class that exists in the cluster:
24+
+
25+
[source,yaml]
26+
----
27+
apiVersion: hco.kubevirt.io/v1beta1
28+
kind: HyperConverged
29+
metadata:
30+
name: kubevirt-hyperconverged
31+
spec:
32+
scratchSpaceStorageClass: "<storage_class>" <1>
33+
----
34+
<1> If you do not specify a storage class, CDI uses the storage class of the persistent volume claim that is being populated.
35+
36+
. Save and exit your default editor to update the `HyperConverged` CR.

modules/virt-editing-cdi-cpu-and-memory-defaults.adoc

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-cdi-for-namespace-resourcequota.adoc
4+
5+
[id="virt-overriding-cpu-and-memory-defaults_{context}"]
6+
= Overriding CPU and memory defaults
7+
8+
Modify the default settings for CPU and memory requests and limits for your use case by adding the `spec.resourceRequirements.storageWorkloads` stanza to the `HyperConverged` custom resource (CR).
9+
10+
.Prerequisites
11+
12+
* Install the OpenShift CLI (`oc`).
13+
14+
.Procedure
15+
16+
. Edit the `HyperConverged` CR by running the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ oc edit hco -n openshift-cnv kubevirt-hyperconverged
21+
----
22+
23+
. Add the `spec.resourceRequirements.storageWorkloads` stanza to the CR, setting the values based on your use case. For example:
24+
+
25+
[source,yaml]
26+
----
27+
apiVersion: hco.kubevirt.io/v1beta1
28+
kind: HyperConverged
29+
metadata:
30+
name: kubevirt-hyperconverged
31+
spec:
32+
resourceRequirements:
33+
storageWorkloads:
34+
limits:
35+
cpu: "500m"
36+
memory: "2Gi"
37+
requests:
38+
cpu: "250m"
39+
memory: "1Gi"
40+
----
41+
42+
. Save and exit the editor to update the `HyperConverged` CR.

modules/virt-understanding-scratch-space.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The Containerized Data Importer (CDI) requires scratch space (temporary storage)
99
During this process, CDI provisions a scratch space PVC equal to the size of the PVC backing the destination data volume (DV).
1010
The scratch space PVC is deleted after the operation completes or aborts.
1111

12-
You can define the storage class that is used to bind the scratch space PVC in the `spec.config.scratchSpaceStorageClass` field of the `CDI` object.
12+
You can define the storage class that is used to bind the scratch space PVC in the `spec.scratchSpaceStorageClass` field of the `HyperConverged` custom resource.
1313

1414
If the defined storage class does not match a storage class in the cluster, then the default storage class defined for the cluster is used.
1515
If there is no default storage class defined in the cluster, the storage class used to provision the original DV or PVC is used.

virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes-block.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Refer to the operating system documentation for details.
2424

2525
* If you require scratch space according to the
2626
xref:#virt-cdi-supported-operations-matrix_virt-importing-virtual-machine-images-datavolumes-block[CDI supported operations matrix], you must first
27-
xref:../../../virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc#virt-defining-storageclass-in-cdi_virt-preparing-cdi-scratch-space[define a storage class or prepare CDI scratch space]
27+
xref:../../../virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc#virt-defining-storageclass_virt-preparing-cdi-scratch-space[define a storage class or prepare CDI scratch space]
2828
for this operation to complete successfully.
2929

3030
include::modules/virt-about-datavolumes.adoc[leveloffset=+1]

virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ in the same namespace as the data volume and referenced in the data volume confi
2626
** You might need to xref:../../../virt/virtual_machines/virtual_disks/virt-using-container-disks-with-vms.adoc#virt-preparing-container-disk-for-vms_virt-using-container-disks-with-vms[prepare a container disk from a virtual machine image] and store it in your container registry before importing it.
2727
** If the container registry does not have TLS, you must xref:../../../virt/virtual_machines/virtual_disks/virt-using-container-disks-with-vms.adoc#virt-disabling-tls-for-registry_virt-using-container-disks-with-vms[add the registry to the `insecureRegistries` field of the `HyperConverged` custom resource] before you can import a container disk from it.
2828

29-
* You might need to xref:../../../virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc#virt-defining-storageclass-in-cdi_virt-preparing-cdi-scratch-space[define a storage class or prepare CDI scratch space]
29+
* You might need to xref:../../../virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc#virt-defining-storageclass_virt-preparing-cdi-scratch-space[define a storage class or prepare CDI scratch space]
3030
for this operation to complete successfully.
3131

3232
include::modules/virt-cdi-supported-operations-matrix.adoc[leveloffset=+1]

virt/virtual_machines/virtual_disks/virt-configuring-cdi-for-namespace-resourcequota.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ You can use the Containerized Data Importer (CDI) to import, upload, and clone v
99

1010
include::modules/virt-about-cpu-and-memory-quota-namespace.adoc[leveloffset=+1]
1111

12-
include::modules/virt-editing-cdi-cpu-and-memory-defaults.adoc[leveloffset=+1]
12+
include::modules/virt-overriding-cpu-and-memory-defaults.adoc[leveloffset=+1]
1313

14+
[id="{context}_additional-resources"]
1415
== Additional resources
1516

1617
* xref:../../../applications/quotas/quotas-setting-per-project.adoc#quotas-setting-per-project[Resource quotas per project]

virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ include::modules/virt-understanding-scratch-space.adoc[leveloffset=+1]
1111

1212
include::modules/virt-operations-requiring-scratch-space.adoc[leveloffset=+1]
1313

14-
include::modules/virt-defining-storageclass-in-cdi.adoc[leveloffset=+1]
14+
include::modules/virt-defining-storageclass.adoc[leveloffset=+1]
1515

1616
include::modules/virt-cdi-supported-operations-matrix.adoc[leveloffset=+1]
1717

18-
.Additional resources
18+
[id="{context}-additional-resources"]
19+
== Additional resources
1920

20-
* See the xref:../../../storage/dynamic-provisioning.adoc#about_dynamic-provisioning[Dynamic provisioning] section for more information on storage classes and how these are defined in the cluster.
21+
* xref:../../../storage/dynamic-provisioning.adoc#about_dynamic-provisioning[Dynamic provisioning]

0 commit comments

Comments
 (0)