Slot size in HA

What is Slot Size?

In VMware High Availability (HA), a slot is a logical representation of the CPU and memory resources required by a single VM. The slot size is determined based on the highest CPU and memory reservations set on any VM in the cluster. This concept helps VMware HA to allocate and reserve resources efficiently to ensure that VMs can be restarted on a different host in the event of a host failure.

Understanding HA Slot Size

A slot is a logical representation of the CPU and memory resources that satisfy the requirements of the most demanding VM in the cluster. The slot size is determined based on the highest CPU and memory reservations set on any VM in the cluster.

Detailed Calculation Process

Step 1: Determine the CPU Slot Size

  • Identify the VM with the highest CPU reservation.
  • If no VM has a CPU reservation, a default value is used (32 MHz by default in vSphere 6.5 and later).

Example:

  • VM1: 1 GHz (1000 MHz)
  • VM2: 500 MHz
  • VM3: No reservation (default 32 MHz)

Highest CPU reservation = 1000 MHz

Thus, the CPU slot size = 1000 MHz

Step 2: Determine the Memory Slot Size

  • Identify the VM with the highest memory reservation.
  • If no VM has a memory reservation, a default value is used (128 MB by default in vSphere 6.5 and later).

Example:

  • VM1: 2 GB (2048 MB)
  • VM2: 1 GB (1024 MB)
  • VM3: No reservation (default 128 MB)

Highest memory reservation = 2048 MB

Thus, the memory slot size = 2048 MB

Step 3: Calculate the Number of Slots Per Host

Once you have the slot sizes, you can calculate the number of slots each host in the cluster can support.

Example: Assume you have a host with the following resources:

  • Total CPU: 20 GHz (20000 MHz)
  • Total Memory: 64 GB (65536 MB)
  • CPU slots per host: Total CPU / CPU slot size = 20000 MHz / 1000 MHz = 20 slots
  • Memory slots per host: Total Memory / Memory slot size = 65536 MB / 2048 MB = 32 slots

The total number of slots a host can support is the lesser of the CPU slots and memory slots:

  • Minimum(20 CPU slots, 32 Memory slots) = 20 slots

Step 4: Determine the Cluster Slot Size

To determine the cluster’s slot size, you need to account for all hosts in the cluster and the HA failover level.

Example: Assume a cluster with 4 hosts, each with the same resources as mentioned above, and an HA configuration to tolerate 1 host failure.

  • Total slots in cluster = Number of hosts * Slots per host = 4 * 20 = 80 slots
  • Slots reserved for failover = Slots per host = 20 slots
  • Available slots for VMs = Total slots – Slots reserved for failover = 80 – 20 = 60 slots

Step 5: Determine VM Slot Requirements

Now, determine how many slots each VM will consume based on its reservations.

Example:

  • VM1: 2 CPU slots (2000 MHz reservation) and 1 Memory slot (2048 MB reservation) = 2 slots
  • VM2: 1 CPU slot (500 MHz reservation) and 1 Memory slot (1024 MB reservation) = 1 slot
  • VM3: 1 CPU slot (32 MHz reservation) and 1 Memory slot (128 MB reservation) = 1 slot

If you have more VMs, calculate similarly and sum up the total number of slots required.

Final Considerations

  • Overcommitment: If your total slots required by VMs exceed the available slots, you may be overcommitting resources, which can lead to performance issues.
  • Adjusting Reservations: Adjusting CPU and memory reservations on VMs can affect the slot size and the number of slots available.
  • Admission Control Policies: Ensure your HA admission control policies align with your business requirements for availability and performance.

Example Scenario

Let’s go through an example scenario:

  1. Cluster Configuration:
    • 4 hosts, each with 20 GHz CPU and 64 GB Memory
    • HA configured to tolerate 1 host failure
  2. VM Reservations:
    • VM1: 2 GHz CPU, 2 GB Memory
    • VM2: 500 MHz CPU, 1 GB Memory
    • VM3: No reservation (default values)
  3. Calculate Slot Sizes:
    • CPU slot size = 2000 MHz (based on VM1)
    • Memory slot size = 2048 MB (based on VM1)
  4. Slots per Host:
    • CPU slots per host = 20000 MHz / 2000 MHz = 10 slots
    • Memory slots per host = 65536 MB / 2048 MB = 32 slots
    • Slots per host = Minimum(10, 32) = 10 slots
  5. Cluster Slots:
    • Total slots in cluster = 4 hosts * 10 slots per host = 40 slots
    • Slots reserved for failover = 10 slots (1 host)
    • Available slots for VMs = 40 – 10 = 30 slots
  6. VM Slot Requirements:
    • VM1: 2 slots
    • VM2: 1 slot
    • VM3: 1 slot
    • Total slots required by VMs = 2 + 1 + 1 = 4 slots

In this scenario, the cluster can comfortably support the VMs even with a failover capacity for one host.

By understanding and applying these calculations, you can ensure your VMware cluster is correctly configured for High Availability, providing the necessary resources to your VMs in case of host failures.

Leave a comment