Skip to content

Commit 16d1f4f

Browse files
committed
compute resources
1 parent 53ea37c commit 16d1f4f

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,6 +4036,8 @@ Topics:
40364036
File: virt-high-availability-for-vms
40374037
- Name: Control plane tuning
40384038
File: virt-vm-control-plane-tuning
4039+
- Name: Assigning compute resources
4040+
File: virt-assigning-compute-resources
40394041
- Name: VM disks
40404042
Dir: virtual_disks
40414043
Topics:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/advanced_vm_management/virt-assigning-compute-resources.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-setting-cpu-allocation-ratio_{context}"]
7+
= Setting the CPU allocation ratio
8+
9+
The CPU Allocation Ratio specifies the degree of overcommitment by mapping vCPUs to time slices of physical CPUs.
10+
11+
For example, a mapping or ratio of 10:1 maps 10 virtual CPUs to 1 physical CPU by using time slices.
12+
13+
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.
14+
15+
.Procedure
16+
17+
Set the `vmiCPUAllocationRatio` value in the `HyperConverged` CR to define a node CPU allocation ratio.
18+
19+
. Open the `HyperConverged` CR in your default editor by running the following command:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
24+
----
25+
26+
. Set the `vmiCPUAllocationRatio`:
27+
28+
+
29+
[source,yaml]
30+
----
31+
...
32+
spec:
33+
resourceRequirements:
34+
vmiCPUAllocationRatio: 1 <1>
35+
# ...
36+
----
37+
<1> When `vmiCPUAllocationRatio` is set to `1`, the maximum amount of vCPUs are requested for the pod.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="virt-assigning-compute-resources"]
3+
= Assigning compute resources
4+
include::_attributes/common-attributes.adoc[]
5+
:context: virt-assigning-compute-resources
6+
7+
toc::[]
8+
9+
In {VirtProductName}, compute resources assigned to virtual machines (VMs) are backed by either guaranteed CPUs or time-sliced CPU shares.
10+
11+
Guaranteed CPUs, also known as CPU reservation, dedicate CPU cores or threads to a specific workload, which makes them unavailable to any other workload. Assigning guaranteed CPUs to a VM ensures that the VM will have sole access to a reserved physical CPU. xref:../../../virt/virtual_machines/advanced_vm_management/virt-dedicated-resources-vm.adoc#virt-dedicated-resources-vm[Enable dedicated resources for VMs] to use a guaranteed CPU.
12+
13+
Time-sliced CPUs dedicate a slice of time on a shared physical CPU to each workload. You can specify the size of the slice during VM creation, or when the VM is offline. By default, each vCPU receives 100 milliseconds, or 1/10 of a second, of physical CPU time.
14+
15+
The type of CPU reservation depends on the instance type or VM configuration.
16+
17+
[role="_overcommitting"]
18+
[id="overcommitting_{context}"]
19+
== Overcommitting CPU resources
20+
21+
Time-slicing allows multiple virtual CPUs (vCPUs) to share a single physical CPU. This is known as _CPU overcommitment_. Guaranteed VMs can not be overcommitted.
22+
23+
Configure CPU overcommitment to prioritize VM density over performance when assigning CPUs to VMs. With a higher CPU over-commitment of vCPUs, more VMs fit onto a given node.
24+
25+
include::modules/virt-setting-cpu-allocation-ratio.adoc[leveloffset=+1]
26+
27+
[role="_additional-resources"]
28+
[id="additional-resources_{context}"]
29+
== Additional resources
30+
* link:https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/[Pod Quality of Service Classes]

0 commit comments

Comments
 (0)