Vmware Ha Slot Size Calculations

Posted By admin On 15/04/22
Vmware Ha Slot Size Calculations Rating: 6,9/10 3811 votes

Did you know about VMware HA admission control coupled to VM reservations? To be honest I thought I knew, but recently I was pointed to some details that showed me I was wrong.

Vmware ha slot size calculations cheat

VMware vSphere 4.1 - HA Admission Control Slot Calculation. 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.

  • VMware host failures clusters admission control policy. Here is an excerpt from the document. Slot Size Calculation. Slot size is comprised of two components, CPU and memory. VSphere HA calculates the CPU component by obtaining the CPU reservation of each powered-on virtual machine and selecting the largest value. If you have not specified a.
  • This post clarifies more on the Total Slots, Used Slots & Available slots in VMware HA Slot calculation. I strongly recommend to read my previous post on HA slot calculation to fully understand the concepts of this post. From the above snapshot, Total Slots in Cluster = 234.

What I’m talking about is the cluster setting of “HA Admission Control” and how “Percentage of cluster resources reserved as failover spare capacity” and “Host failures the cluster tolerates” are related to the CPU and memory reservations at VM level. These settings will make sure that your HA cluster will reserve enough resources to recover from host failures, depending on how high you set the % of resources to be reserved, more host failures can be tolerated.

Where did I go wrong? Well I thought vCenter made the calculations for the HA spare capacity based on real usage, using 5min interval. But I was wrong. These calculations are not based on real life numbers but on the reservations you set at the VM level. Same goes for the “Host failures the cluster tolerates” setting, the slot size is based on the reservations being used per VM.

Vmware

Auch, I felt a little embarrassed being wrong in this. Especially since I normally checked on reservations of VMs being set to zero if there was no special need for a reservation. But as I started asking around to people on what they used for their VM reservations, I learned that not many were using these VM reservations and more people then I expected also had the wrong idea about this.

Vmware Ha Slot Size Calculations Chart

So, to be clear once and for all:

The values used in calculations for “Host failures the cluster tolerates” and “Percentage of cluster resources reserved as failover spare capacity” are based on the CPU and memory reservations set at VM level.

And to proof that setting no reservations can overload your cluster, have a look at my lab environment where I have set NO reservations on any of the VMs. My three hosts have 8GB of RAM each and when you look at the current load, you can see that my current memory usage is 52%, 52% and 92% which makes a total of 15.7 GB of RAM in use of the 24GB I have in my lab. Which is 65%. Now the vSphere HA status box on the summary page of the cluster shows that I have a “Current Memory Failover Capacity” of 81%. Anyone can see that’s not right. If you’re asking why the 81% and not a full 100%, those 19% are lost on VM memory overhead. But it might be clear that I can’t power on another 81% of 24GB = 19GB of VMs and still have 25% spare HA failover capacity.

For details on how the calculations are made, check Duncan’s VMware HA DeepDive Guide, a must read.

Now I have two questions for you, please respond in the comments:

Vsphere Ha Slot Size Calculation

  • The “make me feel a little better” question: Did you know about this?
  • What is the default reservation on CPU and RAM you are using in your environment. Of course, special VMs will have different requirements, but as a ‘rule of thumb’ what is the % of reservation you set?

Update:

  • Frank Denneman responded to my post on his blog: THE ADMISSION CONTROL FAMILY
  • Chris Colotti also responded to my post on his blog: Bad Idea: Disabling HA Admission Control With vCloud.
  • My colleague Menno De Liege wrote a post on how to easily change the reservation of a VM: HA Admission Control: Base VM reservation on percentage.

Do you have HA enabled cluster ? If you do then you will need to know what a slot size is, that’s if you don’t already, if you do already then just cut straight to the cool PowerCLI example….

I’m not going to explain this completely as I could never write such an excellent explanation as Duncan over at Yellow bricks, I highly recommend reading this post as it is pure excellence.

Vmware Ha Slot Size Calculations

So what is a slot size ?

If you have a HA enabled cluster and have set the admission control to ‘Prevent VMs from being powered on if they violate availability constraints’, this means when your cluster does not have enough room to start VMs if a host fails then you will violate the constraints of the cluster and vCenter will not allow you to power on your next VM, but how does it know when you do not have enough room for another VM to power on ?

Enter slot’s, a slot is measurement, the measurement is made up of a CPU Mhz reservation and Memory reservation, if there is no reservation a default of 256Mhz will be used for the CPU and the for the memory the memory overhead will be used, to make sure the cluster has enough room it will always look for a worst case CPU reservation and a worst case memory reservation scenario, so if you have a number of VMs in the cluster vCenter will base your slot size on the worst case MHZ and MB you have, if you have 50 x 2Ghz reserved, 4GB reserved web servers and 1 x 4Ghz reserved, 3GB reserved SQL server the slot size will be based on 4Ghz and 4GB, and how many of these can be fit into the cluster.

It depends on your thoughts as to whether you think this is a good way of working this out or if this not, would you base it on an average CPU and memory across all of your VM’s ? Personally I can see why VMware have done this as they need to know that the VMs will have enough room to power on if there is a host failure. Don’t forget, if you think you know better then you can change the advanced configuration for VMware HA by following this guide.

Vmware Ha Slot Size Calculations Calculator

Again, I highly recommend reading both Duncan’s HA Deep Dive post and his recent slot size post as I have just touched on the subject (and missed all the main details).

So anyway, where does PowerCLI fit in ?

Calculator

With the following script you can view the slot information, you can see how many slots are available for each cluster and also the CPU and Memory details:

Vmware Ha Slot Size Calculation

Please note that this information unfortunately is not in the 3.5 API so this code will only work on vSphere.

Example Output:

Vmware ha slot size calculations cheat

Cluster : Production
TotalSlots : 32
UsedSlots : 10
AvailableSlots : 22
SlotNumvCPUs : 1
SlotCPUMHz : 256
SlotMemoryMB : 118

Vmware Ha Slot Size Calculations Cheat

And here is the code:

So what if you use the VESI ?

Ok, I have decided to start adding my little code snippets to a PowerPack which I will keep in a central place on my site and upload with all my little on-liners and scripts, you can download my custom PowerPack, import it into the VESI and suddenly you will have more actions available to you, the first in this PowerPack is available under the Clusters node as seen below:

Just select a cluster, or multiple clusters and click Slot Information, you will then see the information displayed in the VESI interface:

Vmware Ha Slot Size Calculations Formula

Keep an eye out on my site for more VESI integrations, expanding the already amazing product into further regions.