Shares explained

Shares in vSphere specify the relative priority of a VM’s access to a given resource (such as CPU, memory, or storage). If an ESXi host comes under contention and must decide which VM gets access to which resources, VMs with higher shares assigned will have higher priority, and therefore greater access, to the ESXi host’s resources.

Note that the share mechanism operates only when VMs are contenting for the same resource. If an ESXi host has plenty of the resource available, shares will not play a role. However, when the resource is scarce and ESXi must decide which VMs should be given access to it, shares can establish a proportional share system. For example, if two VMs want more of the resource than their reservation limit and the ESXi host can’t satisfy both of them, the VM with the greater share value will get higher-priority access to the resource in the ESXi host than the other.

To understand what a proportional share system really means, consider the following example (image source: VMware):

esxi shares expained

In the first row you can see that, in the beginning, each virtual machine has the same number of shares (1000). This means that each virtual machine will receive an equal quantity of the resource (33%) from the ESXi host, if the host comes under contention.

In the second row you can see that the number of the shares has been changed. Now, the total number of shares is 5000. Notice that VM B has more shares (3000) than the other two VMs (1000). In the case of contention, VM B will receive 60% of the resource from the ESXi host.

In the third row you can see that the fourth VM, VM D, has been powered on. Now, the total number of shares is 6000. The other virtual machines will decline in value: VM B will receive only 50% of the resource, while other three virtual machines will receive about 16%, or one-sixth of the resource.

In the fourth row you can see that VM C has been deleted. Since fewer total shares remain, the surviving VMs will receive more quantity of the resource.

Geek University 2021