Upon checking ESXi compliance with an image fails with the below error:
A failure occurred when starting a host compliance check operation on host 'host_fqdn' : Error: com.vmware.vapi.std.errors.not_allowed_in_current_state Messages: com.vmware.esx.task.contention<Another task is in progress. Please retry later.>
Probable stale compliance check tasks pending on host.
Put the host in maintenance mode and Restart the management agents hostd
and vpxa.
Refer to the article below to restart the managements agents.
Restarting Management Agents in ESXi
Note: Restarting the host's management agents may impact currently running tasks, including impact on the guest virtual machines on the host.
If the issue persists even after restarting the management agents, reboot
the affected host.