Symptoms:
Error: com.vmware.vapi.std.errors.not_allowed_in_current_state
Messages: com.vmware.esx.lifecycle.task.contention<Another task possibly in progress. Try later
YYYY-MM-DDTHH:MM:SS settingsd[2101990]: [WriteToFile] Unable to open file: /var/vmware/lifecycle/lifecycle.task
YYYY-MM-DDTHH:MM:SS settingsd[2101990]: [_CheckTaskContention]: Failed to write to the pid file in task xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx606553: std::exception
This issue is resolved in ESXi 7.0.U3c (Build Number 19193900), where the routine task will no longer remove the files in /var/vmware/lifecycle.
Workaround:
To work around this issue, configure a persistent scratch location and restart the settingsd service
/etc/init.d/settingsd restart
Note: Restarting the settingsd services should recreate the files in /var/vmware/lifecycle, however, they are subject to removal again until /scratch is persistent or the host is upgraded to ESXi 7.0 U3+.