mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
41 lines
1.3 KiB
Plaintext
41 lines
1.3 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
|
|
|
|
[role="_abstract"]
|
|
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.
|
|
|
|
.Prerequisites
|
|
|
|
* You have installed the {oc-first}.
|
|
|
|
.Procedure
|
|
|
|
. 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.
|