vSphere Lifecycle Manager Compliance Scan Fails with Task Contention Error (ESXi)
search cancel

vSphere Lifecycle Manager Compliance Scan Fails with Task Contention Error (ESXi)

book

Article ID: 453693

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

A vSphere Lifecycle Manager (vLCM) compliance scan fails, and the vCenter Server reports the host status as "Unknown." The task fails with the error message: "A failure occurred when starting a host compliance check operation on host : Error: com.vmware.vapi.std.errors.not_allowed_in_current_state Messages: com.vmware.esx.task.contention".

Symptoms

  • The compliance scan fails with the error: com.vmware.esx.task.contention.
  • The vCenter /var/log/vmware/vmware-updatemgr/vum-server/vmware-vum-server.log displays com.vmware.vcIntegrity.lifecycle.HostScan.TaskApiError.
  • The host /var/run/log/settingsd.log reports a sync file exists: Task sync file exists and contains 'PRECURSOR: [UUID]'.
  • The file /var/vmware/lifecycle/lifecycle.task contains a 'PRECURSOR' task.

 

Environment

VMware vSphere ESXi 8.0 and later
VMware vCenter Server 8.0 and later

Cause

A stale compliance scan process is stuck in the local ESXi host lifecycle database. vCenter incorrectly believes a scan operation is already in progress, preventing new compliance tasks from initiating.

Resolution

Perform the following steps on the affected ESXi host:

  1. Log in to the ESXi host via SSH.
  2. Check for the existence of the /var/vmware/lifecycle/ directory. If the directory is inaccessible or missing, proceed directly to Step 5.
  3. Move the lifecycle database files to a temporary location to clear the cache: mv /var/vmware/lifecycle/lifecycle.task /tmp/ mv /var/vmware/lifecycle/task-status.json /tmp/ mv /var/vmware/lifecycle/task-status.json.db /tmp/
  4. Restart the settingsd service: /etc/init.d/settingsd restart
  5. If the issue persists or if the lifecycle directory is missing, perform a full reboot of the ESXi host.
  6. Run a new compliance scan in the vSphere Client.