Vsphere Ha Slot Size



Slot size is calculated using the largest reservations plus the memory overhead of any powered on virtual machines in the cluster. However, vSphere HA admission control considers only the resources on a host that are available for virtual machines. Haadmissioncontrolslotpolicyuseexplicitsize - (Optional) Controls whether or not you wish to supply explicit values to CPU and memory slot sizes. The default is false, which tells vSphere to gather a automatic average based on all powered-on virtual machines currently in the cluster. Using the slot policy, vSphere HA performs admission control in the following way: For my work i had to install a supermicro server with ESXi 5.1. This server had a adaptec 3405 raid card which works fine with ESXi 5.x but you can’t see the health status of the array(s) in the VSphere Client.

  1. Vsphere Ha Slot Size Chart
  2. Vsphere Ha Slot Size Calculation
  3. Vsphere Ha Slot Size Chart

Recently I have been asked by my customers and also blog readers 🙂 about VMware HA Admission Control. As this topic is often misunderstood, this post covers some information about this important feature of VMware vSphere HA.

In this post you will find answers for the following questions:

  1. What is Admission Control?
  2. What is and how to check slote size?
  3. When and which Admission Control Policy should I use? How to solve Insufficient Resources for HA failover?

Admission control is used to ensure that sufficient resources are available in a cluster to provide failover protection and to ensure that virtual machine resource reservations are respected. There are three Admission control policies:

  1. Percentage of Cluster Resources Reserved Admission Control Policy
  2. Host Failures Cluster Tolerates Admission Control Policy

It's very important to mention that Percentage of Cluster Resources Reserved and Host Failures Cluster Tolerates are based on CPU and memory reservations at Virtual Machine (VM) level (it ignores resource pools reservation settings). But only? Nope, also overhead reservation is taken into considerations. So the formula is:

Configured Reservation for VM + Overhead Reservation

Overhead Reservation depends on VM configuration and usage (for example: RAM, devices etc). It means that for a large VMs with not configured reservation (equals 0), there is a noticeable Overhead Reservation!

Specify Failover Hosts

The easiest option (it does not mean the best 🙂 ) of Admission Control. vSphere HA attempts to restart its virtual machines on one of the specified failover hosts.

Host Failures Cluster Tolerates

With the Host Failures Cluster Tolerates admission control policy, vSphere HA uses slot to ensure that a specified number of hosts can fail and sufficient resources remain in the cluster to fail over all the virtual machines from those hosts.

Slot is a logical representation of CPU and memory. Depending on vSphere version, the default slot size is 0 MB of RAM and 256 MHz CPU (4.1 and earlier) or 0 MB of RAM and 32Mhz (5.0 and later).

The admission control is performed by VMware HA with the following steps:

  1. Calculates the slot size (based on powered-on VMs and selections the largest value).
  2. Determines how many slots each host in the cluster can hold.
  3. Determines the Current Failover Capacity of the cluster.
  4. Determines whether the Current Failover Capacity is less than the Configured Failover Capacity.

So let's make an example. As shown on the above figure, we have three ESXi hosts each with a different amount of available CPU and memory resources:

  • ESXi1 - 9GB of RAM and 9Ghz of CPU
  • ESXi2 - 6GB of RAM and 9Ghz of CPU
  • ESXi3 - 6GB of RAM and 6Ghz of CPU
Vsphere Ha Slot Size

There are five powered-on VMs:

  • VM1 and VM2 - 1GB of RAM and 2GHz of CPU
  • VM3 - 2GB of RAM and 1GHz of CPU
  • VM4 and VM5 - 1GB of RAM and 1GHz of CPU

As mentioned earlier, the slot size is the largest value so in this example: the slot size is 2GHz of CPU and 2GB of memory.

So how many slots are available per hosts?

  • ESXi1 - 3 slots
  • ESXi2 - 3 slots
  • ESXi3 - 4 slots

If ESXi3 host fails, we have available 6 slots (3+3) so sufficient resources are available in a cluster to provide failover protection (one slot available yet to create).

Since vSphere 5.x, it is possible to configure the default slot size via Web Client:

If you use Standard Client or vSphere 4.x, you need to change some advanced parameters such as das.slotmeminmb and das.slotcpuinmhz. For more information please follow VMware KB here.

Percentage of Cluster Resources Reserved

The Percentage of Cluster Resources Reserved works different - vSphere HA ensures that a specified percentage of aggregate CPU and memory is reserved for failover.

The admission control is performed by VMware HA with the following steps:

  1. Calculates the total resource requirement for all powered on machines in the cluster.
  2. Calculates the total host resources available for the virtual machines.
  3. Calculates the current CPU and Memory failover capacity for the cluster (specified by administrator).
  4. Determines if either the current CPU failover or current memory failover is less than the corresponding failover capacity.

As shown on the above figure, there are five VMs and three ESXi hosts and the total VMs requirements for the powered-on VMs is 6GB of RAM and 7GHz of CPU. To calculate the Current CPU Failover Capacity we use the following formula:

(Total host resources - Total VMs requirements) / Total host resources

so CPU: (24-7) / 24 = 70% and Memory: (21-6) / 21 = 71%

If you specify 33% CPU and Memory Failover Capacity, you have around 35% of resource available for new VMs yet 🙂

Insufficient Resources for HA failover

Sometimes you can get the following error during configuring vSphere HA with Admission Control enabled:

Insufficient Resources for HA failover

In most of all cases, the above error can happen when you configure Host Failures Cluster Tolerates Admission Control policy. Why? For example you have a large VM (with large reservation so slot size is also large) and when vSphere HA calculates powered on VMs and available slots on all ESXi hosts, it can be a situation when sufficient resources are not available in a cluster to provide failover protection. To solve this problem you should revise the VMs reservations or reconfigure Admission Control to use the Percentage of Cluster Resources Reserved policy.

When and which Admission Control Policy should I use?

Generally I use the Percentage of Cluster Resources Reserved policy because it's much simpler and more flexible than Host Failures Cluster Tolerates Admission Control policy. Of course, you have to remember that when you add or remove ESXi hosts from your cluster, you need to reconfigure percentages. Also if you have an unbalanced vSphere Cluster you should use the Percentage of Cluster Resources Reserved policy.

Vsphere

Conclusion

Vsphere Ha Slot Size Chart

I hope that Admission Control is understandable for you now 🙂 For more information (much deeper) please follow a fantastic book written by Duncan Epping: VMware vSphere 5.1 Clustering Deepdive 🙂

Posted on 07 Feb 2011 by Ray Heffer

VMware HA (High Availability) admission control is something I wanted to understand better so I started making notes gathered from various sources on the subject, and in particular the way slot sizes are calculated. Duncan Epping’s Yellow Bricks site already covers HA very well and I bow down to his knowledge on the subject, well worth checking out. Also I would strongly recommend VMware vSphere 4.1 HA and DRS Technical Deepdive by Duncan Epping and Frank Denneman which I purchased at Comcol.nl which they shipped to me in the UK in just two days.

That said, I thought I would share my own views and notes I have taken on the subject. The vSphere Availability guide states “A slot is a logical representation of memory and CPU resources. By default, it is sized to satisfy the requirements for any powered-on virtual machine in the cluster.” - In simple terms a slot can be consumed by a single virtual machine, but a virtual machine may consume more than one slot.

When you create an HA enabled cluster, the default admission control policy is set to “Host failures cluster tolerates”. It is important to understand how this works to avoid any ‘schoolboy errors’ or mis-calculations in your design.

Rule # 1: Remember this, “The hostess with the mostess” - the ESX host with the most available slots will be taken out of the equation when calculating HA admission control. If your ESX cluster has 6 hosts with 16GB memory, and one host with 32GB memory then this will be excluded from the calculation.

Calculating the Slot Size (memory and CPU)

Firstly, do any virtual machines have a reservation on the CPU or memory? If so, then the virtual machine with the largest reservation on a given host is taken into account. For virtual machines that have no reservations, the slot size is calculated with the CPU at 256Mhz and memory at the VM overhead (E.g. 123.73MB - See page 28 of vsp_41_resource_mgmt.pdf). Repeat this for the remaining virtual machines on the host (see flowchart).

Flowchart Example

Lets say that we have 10 virtual machines (1 vCPU each) and two of them have reservations as follows:

VM 1 - Has a CPU reservation of 700Mhz, and no memory reservation.VM 2 - Has a CPU reservation 500Mhz and memory reservation of 1024Mb.VM 3 to 10 - No reservations on memory or CPU. (keeping this example simple)

The slot size calculation will take the largest reservation for memory and CPU. In this example the result would be:

CPU: 700MhzMemory: 1147.73MB (1024Mb plus overhead)

Rule # 2: Remember that the biggest reservation will be used for memory and CPU. If no reservations are set, then it will use 256Mhz for the CPU and 0MB + virtual machine overhead for the memory.

Calculating the Number of Slots Available

Now we have the slot size for our ESX host, the next step is to work out how many slots we have. In order to calculate this, simply divide the CPU and memory available on the host by CPU and memory slot size. For example, using our figures above (700Mhz and 1144.73Mb), say our host has 5934 Mhz CPU available and 7126MB memory, our slot sizes will be 8 for the CPU and 6 for the memory.

5934 /700 = 87126 / 1147.73 = 6

Vsphere Ha Slot Size Calculation

Vsphere ha slot size calculation

Result: Take the smaller of the two, and our ESX host has 6 available slots. Do this for each host in the cluster and you have the total number of slots available in your cluster (minus the host with the most slots).

Rule # 3: It will always use the smallest number of slots from CPU or memory.

What Does This All Mean?

Now we understand how slots are calculated on each of our ESX hosts, it gives us a better insight when determining how your HA will be configured. Here is a simple check-list of questions you should ask yourself:

  1. Do any of my virtual machines have CPU or memory reservations set?
  2. Are all of my ESX hosts of the same specification, or do I have one or two with significantly more CPU or RAM?
  3. How many host failures do I need to tolerate?

Some possible solutions:

Vsphere Ha Slot Size Chart

  1. Don’t use virtual machine reservations unless absolutely necessary, instead use resource pools with reservations as these are not used in the slot size calculation.
  2. Keep the hosts in your cluster of similar specification (same CPU and memory) otherwise it could be eliminated when calculating the number of slots to use.
  3. Do you need an HA policy based on a number of host failures? Use ‘Percentage of cluster resources reserved as failover spare capacity’.