Resource Allocation and Overcommit
Resource allocation describes the CPU, memory, and storage resources that are occupied or reserved by VMs. Resource overcommit allows physical resources to be virtualized at a specified ratio and then allocated to VMs.
CPU overcommit ratio, memory overcommit ratio, and data storage overcommit ratio together affect the upper limit of resources available to VMs. Host reserved memory reserves the memory required by the KVM host system. Data storage reserved capacity and threshold capacity help protect storage space. When planning resources, consider the physical total, reserved capacity, overcommit ratio, allocated capacity, and remaining allocatable capacity together.
Resource Allocation Terms
| Term | Description |
|---|---|
| Physical total | Total physical CPU, physical memory, or data storage capacity that can participate in allocation. |
| Reserved capacity | Resource capacity reserved for host system operation or storage safety. Memory calculation first deducts host reserved memory, and storage calculation first deducts reserved capacity before calculating allocatable capacity. |
| Overcommit ratio | The multiplier used to calculate how much virtualized capacity can be allocated from physical resources. A higher overcommit ratio increases the logical resource or storage capacity that can be allocated to VMs. |
| Allocated capacity | The logical resource capacity that has been allocated to VMs or related resources. |
| Free to allocate | The remaining capacity after allocated capacity is deducted from the total allocatable capacity. |
Configure Cluster Overcommit
Configure CPU overcommit ratio, memory overcommit ratio, and host reserved memory in the cluster advanced settings to control the computing resources available to VMs in a cluster.
Procedure
-
Go to the configuration entry of the target cluster.
On the target cluster page, click . You can also go to the Advanced Settings tab of the cluster to modify the settings.
-
In the cluster advanced settings, configure computing resource overcommit options as needed.
Option Description CPU Overcommit Ratio Controls the number of virtual CPUs that can be allocated to VMs. Allocatable virtual CPUs = physical CPU total threads in the cluster x CPU overcommit ratio. Memory Overcommit Ratio Controls the amount of virtual memory that can be allocated to VMs. Allocatable virtual memory capacity = (physical memory capacity - reserved capacity) x memory overcommit ratio. - Confirm the configuration and click OK.
Configure Storage Overcommit
Configure the data storage overcommit ratio in the data storage advanced settings to control the data storage space that can be allocated to VMs.
About this task
The data storage overcommit ratio controls the allocatable data storage space for VMs. Local storage, NFS storage, SAN storage, and distributed storage all support storage overcommit configuration in their corresponding data storage settings.
Procedure
-
Go to the configuration entry of the target data storage.
The configuration entries and configurable options vary by data storage type. For details about configuration entries for each data storage type, see:
-
In the data storage advanced settings, set Data Storage Overcommit Ratio.
The data storage overcommit ratio is used to calculate the allocatable capacity of data storage. The calculation formula is as follows:
Data storage allocatable capacity = [(actual capacity - reserved capacity) x overcommit ratio] - (threshold capacity + sum of all disks allocated to VMs + snapshots + image cache + migration cache)
Note: SAN storage also provides advanced settings such as disk preallocation policy and storage allocation strategy. When modifying SAN storage configuration, set the overcommit ratio based on the storage provisioning method and service capacity plan. - Confirm the configuration and click OK.
Resource Allocation and Overcommit Formulas
Capacity Calculation Formulas
| Category | Formula |
|---|---|
| Resource utilization rate | Total CPU = physical cores x single-core GHz |
| Resource allocation ratio |
|
| CPU resource distribution | CPU overcommitted total = physical CPU total x overcommit ratio |
| Memory resource distribution |
|
| Storage resource distribution |
|
Meaning of Overcommit and Allocation
- CPU overcommit: A single physical CPU core can be virtualized into up to N logical CPU cores for allocation to VMs. For example, if the CPU overcommit ratio is 2:1, one physical CPU core can be virtualized into up to two logical CPU cores. If a host has 10 physical CPU cores, up to 20 logical CPU cores can be allocated to VMs.
- Memory/storage overcommit: One unit of memory or storage capacity can be virtualized into up to N units of memory or storage capacity for allocation to VMs. For example, if the memory or storage overcommit ratio is 2:1, 1 GB of memory or storage capacity can be virtualized into up to 2 GB.
- CPU allocation: A physical CPU core is actually virtualized into N logical CPU cores for use by VMs. Therefore, the CPU allocation ratio is less than or equal to the CPU overcommit ratio. For example, if the CPU allocation ratio is 1.5:1, one physical CPU core is actually virtualized into 1.5 logical CPU cores.
- Memory/storage allocation: One unit of memory or storage capacity is actually virtualized into N units of memory or storage capacity. Therefore, the memory or storage allocation ratio is less than or equal to the memory or storage overcommit ratio.
Calculation Example
Using host storage as an example, if the total physical storage capacity is 100 GB, the reserved physical capacity is 10 GB, the overcommit ratio is 2:1, and the allocated capacity is 150 GB, then:
- Storage allocation ratio = 150 GB : 90 GB = 1.67
- Total overcommit storage = 100 GB - 10 GB = 90 GB
- Total allocatable storage = 90 GB x 2 = 180 GB
- Remaining allocatable storage = 180 GB - 150 GB = 30 GB
