Unable to add/remove Virtual Machine from vm-host affinity rule
search cancel

Unable to add/remove Virtual Machine from vm-host affinity rule

book

Article ID: 313517

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:

Unable to add or remove Virtual Machine from vm-host affinity rule. The task starts and gets stuck at 0%

vpxd.log

YYYY-MM-DD HH:MM:SS verbose vpxd[06104] [Originator@6876 sub=StateLock opID=lov4yey9-449735-auto-9n0o-h5:70039410-ac] [VpxdStateLock] Couldn't lock vim.ClusterComputeResource:domain-xxxx in mode EXCLUSIVE. Will retry in a bit...

Environment

VMware vCenter Server 7.0.x
VMware vCenter Server 8.0.x

Cause

ReconfigureEx needs EXCLUSIVE lock for data consistency.

Changing Virtual Machine affinity rules is classified under a cluster reconfiguration, since Virtual Machine affinity rules affect placement decisions throughout the cluster. The cluster reconfigure operation requires an EXCLUSIVE state lock and that stalls until vMotion completes.

Resolution

The cross-cluster(In this case vCenter - vCenter) vMotion takes a SHARED StateLock on the destination cluster, and this is expected since it is making sure that destination resource calculations at the beginning of the vMotion are still valid after the vMotion completes.

Currently there is no resolution to the issue, since any changes to current behaviour will require significant re-architecting. This will be fixed in a future release

Workaround:
The only workaround is to wait for the vMotion tasks to finish.