Lock acquisition timed out for object: 'C4VAPP=<uuid>'
/opt/vmware/h4/cloud/log/cloud.log file
on the destination Cloud Director Replication Management Appliance, you see entries similar to:2024-08-17 15:18:10.900 DEBUG - [be70224f-bcef-4642-8f30-3baf0a9436b2] [c4-scheduler-1] c.vmware.h4.jobengine.lock.LockManager : Expiring candidate c7ce1f8b-7f35-4a51-9b84-2aacad6926f1 for lock vapp_C4VAPP-<uuid>
2024-08-17 15:18:10.900 DEBUG - [UI-e4467c13-ba56-4349-bde8-999c9357a662-r665-QA-iep] [c4-scheduler-1] c.vmware.h4.cloud.job.VmReplicationJob : Failed to acquire lock for RT vApp creation.
2024-08-17 15:18:10.900 ERROR - [UI-e4467c13-ba56-4349-bde8-999c9357a662-r665-QA-iep] [c4-scheduler-1] com.vmware.h4.jobengine.JobExecution : Task c7ce1f8b-7f35-4a51-9b84-2aacad6926f1 (WorkflowInfo{type='start', resourceType='vmReplication', resourceId='C4-<uuid>', isPrivate=false, resourceName='null'}) has failed
com.vmware.h4.manager.api.exceptions.LockTimeoutException: Lock acquisition timed out for object: 'C4VAPP-<uuid>'
at com.vmware.h4.cloud.job.VmReplicationJob.lambda$persistRtVm$29(VmReplicationJob.java:931)
at com.vmware.h4.jobengine.lock.JobLock.lambda$lock$1(JobLock.java:93)
at com.vmware.h4.jobengine.lock.LockManager.invokeHandler(LockManager.java:288)
...
Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.
VMware Cloud Director Availability 4.x
This issue occurs because the default timeout value for a lock in VMware Cloud Director Availability is 10 minutes. When a vApp is configured to be replicated each VM replication task that is spawned is required to own the vApp replication lock when performing necessary configuration tasks. For large vApps, it is possible for this lock timeout to expire before all VM replications are processed, resulting in this error.
To resolve this issue, increase the default timeout value based on the largest vApp you wish to replication and the time observed that it takes for individual VM replications to configure.
Note: This procedure modifies a configuration file. Ensure to take a backup of the file before proceeding.
application.properties
file:cd /opt/vmware/h4/cloud/config/
application.properties
file:cp application.properties application.properties.<YYYY-MM-DD>.bak
vi
:vi application.properties
default.lock.timeout=######
default.lock.timeout=1200000
systemctl restart cloud.service