
vSphere Resource Controls
Learner Objectives
After completing this lesson, you should be able to meet the following objectives:
- Assign share values for CPU and memory resources
- Describe how virtual machines compete for resources
- Define CPU and memory reservations and limits
Reservations, Limits, and Shares
Beyond the CPU and memory configured for a VM, you can apply resource allocation settings to a VM to control the amount of resources granted:
- A reservation specifies the guaranteed minimum allocation for a VM.
- A limit specifies an upper bound for CPU or memory that can be allocated to a VM.
- A share is a value that specifies the relative priority or importance of a VM’s access to a given resource.
Resource Allocation Reservations: RAM
RAM reservations:
- Memory reserved to a VM is guaranteed never to swap or balloon.
- If an ESXi host does not have enough unreserved RAM to support a VM with a reservation, the VM does not power on.
- Reservations are measured in MB, GB, or TB.
- The default is 0 MB.
- Adding a vSphere DirectPath I/O device to a VM sets memory reservation to the memory size of the VM.
Resource Allocation Reservations: CPU
CPU reservations:
- CPU that is reserved for a VM is guaranteed to be immediately scheduled on physical cores. The VM is never placed in a CPU ready state.
- If an ESXi host does not have enough unreserved CPU to support a VM with a reservation, the VM does not power on.
- Reservations are measured in MHz or GHz.
- The default is 0 MHz.
Resource Allocation Limits
RAM limits:
- VMs never consume more physical RAM than is specified by the memory allocation limit.
- VMs might use the VM swap mechanism (.vswp) if the guest OS attempts to consume more RAM than is specified by the limit.
CPU limits:
- VMs never consume more physical CPU than is specified by the CPU allocation limit.
- CPU threads are placed in a ready state if the guest OS attempts to schedule threads faster than the limit allows.
- Usually, specifying a limit is not necessary.
Resource Allocation Shares
Shares define the relative importance of a VM:
- If a VM has twice as many shares of a resource as another VM, the VM is entitled to consume twice as much of that resource when these two VMs compete for resources.
- Share values apply only if an ESXi host experiences contention for a resource.
You can set shares to high, normal, or low. You can also select the custom setting to assign a specific number of shares to each VM.
Setting | CPU Share Values | Memory Share Values |
High | 2,000 shares per vCPU | 20 shares per MB of configured VM memory |
Normal | 1,000 shares per vCPU | 10 shares per MB of configured VM memory |
Low | 500 shares per vCPU | 5 shares per MB of configured VM memory |
Resource Shares Example (1)
VMs are resource consumers. The default resource settings that you assign during VM creation work well for most VMs.
Resource Shares Example (2)
You can add shares to a virtual machine while it is running.
Resource Shares Example (3)
Shares guarantee that a VM is given a certain amount of a resource.
Resource Shares Example (4)
When you delete or power off a VM, fewer total shares remain, so the surviving VMs get more access.
Defining Resource Allocation Settings for a VM
You can edit a VM’s settings to configure CPU and memory resource allocations.
Viewing VM Resource Allocation Settings
You can view reservations, limits, and shares settings for all VMs in a cluster.
Review of Learner Objectives
After completing this vSphere Resource Controls lesson, you should be able to meet the following objectives:
- Assign share values for CPU and memory resources
- Describe how virtual machines compete for resources
- Define CPU and memory reservations and limits