Frequent DRS Migrations for Smaller VMs due to Affinity Rule Violations and Insufficient Per-CPU Capacity
search cancel

Frequent DRS Migrations for Smaller VMs due to Affinity Rule Violations and Insufficient Per-CPU Capacity

book

Article ID: 445798

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

 

  • A specific virtual machine with relatively small CPU and memory configurations experiences frequent automatic DRS migrations (e.g., nearly 100 times within a few days).

  • The vCenter Server vpxd.log file contains thousands of entries indicating DRS is repeatedly attempting to fix affinity rule violations but failing due to resource constraints.

  • Log entries similar to the following are repeatedly observed:
    YYYY-MM-DDTHH:MM:SS. info vpxd[37088] [Originator@6876 sub=cdrsPlmt item=FixRuleViolations opID=WorkQueue-15a1b8f] Vm [vim.VirtualMachine:vm-###,vm-###] failed constraint check false on host [vim.HostSystem:host-###,esxihost-###.<domain>] with <obj ... xsi:type="InsufficientPerCpuCapacity"><faultMessage><key>com.vmware.drs.constraints.cpu.InsufficientPerCpuCapacity</key><arg><key>requestedPerCpu</key>

 

Environment

VMware vSphere 8.x

Cause

This issue is caused by a conflict between VM-Host Affinity Rules, Host CPU Constraints, and the DRS Goodness/Cost Algorithm:

  1. Affinity Rule Violation: The cluster detects that certain VMs are violating VM-Host affinity rules. To bring the cluster back into a compliant state, DRS triggers the FixRuleViolations task to force-evict and migrate VMs to compliant target hosts.

  2. Resource Constraint Failure (InsufficientPerCpuCapacity): When DRS attempts to place the VM onto the mandatory target host, the pre-migration constraint check fails because the destination host does not have enough unreserved CPU capacity per core (requestedPerCpu exceeds maxPerCpu). This causes the migration to fail.

  3. DRS Cost-Benefit Loop (The "Small VM" Bias): Because the rule remains violated, DRS continuously retries the placement logic. When selecting which VM to migrate to free up space or resolve conflicts, the DRS Goodness Algorithm calculates the migration cost. Large VMs require transferring tens or hundreds of gigabytes of memory data over the network, which takes longer and risks high dirty page rates. Smaller VMs have a lower memory footprint and a faster copy time, giving them a much higher "Goodness" score (lowest cost, quickest benefit). Consequently, DRS repeatedly targets the smallest configured VM for migration, leading to the migration loop.

Resolution

To reduce virtual machines from being frequently migrated by auto DRS by the following methods:

Method 1: Address the Target Host CPU Capacity
Manually vMotion non-essential VMs off the target host to free up enough raw CPU capacity to accommodate the required rule.

Method 2: Adjust the DRS Migration Threshold
Change the cluster-wide DRS automation threshold to Conservative. Lowering this threshold increases the "Goodness" threshold required for an automatic migration to trigger. This prevents DRS from constantly executing high-frequency vMotions for marginal performance gains or minor rule corrections.