:_mod-docs-content-type: ASSEMBLY
[id="virt-assigning-compute-resources"]
= Assigning compute resources
include::_attributes/common-attributes.adoc[]
:context: virt-assigning-compute-resources

toc::[]

[role="_abstract"]
In {VirtProductName}, compute resources assigned to virtual machines (VMs) are backed by either guaranteed CPUs or time-sliced CPU shares.

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. Enable dedicated resources for VMs to use a guaranteed CPU.

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.

The type of CPU reservation depends on the instance type or VM configuration.

[role="_overcommitting"]
[id="overcommitting_{context}"]
== Overcommitting CPU resources

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.

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.

include::modules/virt-setting-cpu-allocation-ratio.adoc[leveloffset=+1]

[role="_additional-resources"]
[id="additional-resources_{context}"]
== Additional resources
* xref:../../../virt/managing_vms/advanced_vm_management/virt-dedicated-resources-vm.adoc#virt-dedicated-resources-vm[Enabling dedicated resources for virtual machines]
* link:https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/[Pod Quality of Service Classes]