Introduction to VMware Resource Allocation

Below is some basic information concerning resource allocation for virtual machines within a VMware environment. 

The memory reservation amount specified on the Resources tab of the virtual machine settings is the amount of actual physical memory that the ESX/ESXi host must provide.  The default is 0MB, or no reservation.

vmware_resources_1

For example, 512 MB of memory is set as the reservation value.  This means that the VM is guaranteed 512 MB of “real” memory.  If the VM is configured for 1 GB, the other 512 MB can be provided by “real” memory or the VMkernal swap file.

The Limit parameter sets the actual limit on how much physical memory may be utilized by the virtual machine.  An example would be:

1.  A virtual machine is configured with 1 GB of memory.  So the guest OS within the VM believes it has 1 GB of memory available to use.

2.  A reservation is set to 512 MB.  The ESX/EXSi host must allocate 512 MB of physical memory to this VM.

3.  A limit is set at 768 MB.  If enough physical memory is installed and available, the hypervisor will allocate memory to the VM as needed up to 768 MB.

4.  The 256 MB “gap” between the reservation and the limit may be supplied by either VMKernel swap space or physical memory.

The Shares parameter provides a means of assigning resource priority to virtual machines.  If two virtual machines want more memory than their reservation limit and the ESX/ESXi host can not satisfy both of them using RAM, the share values can be used so that one gets higher-priority access to the RAM in the host.

CPU allocation is similar to memory concerning reservations and limits.

vmware_resources_2

The default CPU reservation is 0MHz.  By default, a virtual machine is not guaranteed any CPU activity by the VMkernel.  The Limits and Shares parameters are similar to the memory options discussed above. 

The general rule is every VM should be created with only a single virtual CPU.  Only when a VM’s performance level dictates the need should an additional CPU be allocated.  The number of cores available should also be considered.  For example, an eight vCPU VM should be created only on a host with eight cores or more.