1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-setting-cpu-allocation-ratio.adoc
2024-03-18 19:46:08 +00:00

37 lines
1.4 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/virtual_machines/advanced_vm_management/virt-assigning-compute-resources.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-setting-cpu-allocation-ratio_{context}"]
= Setting the CPU allocation ratio
The CPU Allocation Ratio specifies the degree of overcommitment by mapping vCPUs to time slices of physical CPUs.
For example, a mapping or ratio of 10:1 maps 10 virtual CPUs to 1 physical CPU by using time slices.
To change the default number of vCPUs mapped to each physical CPU, set the `vmiCPUAllocationRatio` value in the `HyperConverged` CR. The pod CPU request is calculated by multiplying the number of vCPUs by the reciprocal of the CPU allocation ratio. For example, if `vmiCPUAllocationRatio` is set to 10, {VirtProductName} will request 10 times fewer CPUs on the pod for that VM.
.Procedure
Set the `vmiCPUAllocationRatio` value in the `HyperConverged` CR to define a node CPU allocation ratio.
. Open the `HyperConverged` CR in your default editor by running the following command:
+
[source,terminal]
----
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
----
. Set the `vmiCPUAllocationRatio`:
+
[source,yaml]
----
...
spec:
resourceRequirements:
vmiCPUAllocationRatio: 1 <1>
# ...
----
<1> When `vmiCPUAllocationRatio` is set to `1`, the maximum amount of vCPUs are requested for the pod.