vim-cmd vmsvc/getallvms)<TIMESTAMP> Wa(164) Hostd[2099058]: [Originator@6876 sub=IoTracker] In thread 2099049, open("/vmfs/volumes/########-########-####-############/<VM_NAME>/<VM_NAME>.vmx.lck") took over 135141 sec.
vSphere 8.0 U3
During the storage issue, the VM attempted to failover and during this DRS attempted to place it multiple times on different hosts like the below example:
<TIMESTAMP> error vpxd[09695] [Originator@6876 sub=VmProv opID=CdrsLoadBalancer-########-########-01-01] Local-VC Host Migrate failed at vpx.vmprov.PrepareSource for poweredOn VM <VM_NAME>' (vm-####, ds:///vmfs/volumes/########-########-####-############/<VM_NAME>/<VM_NAME>.vmx) on host-#### (#.#.#.#) in pool resgroup-#### with ds ds:///vmfs/volumes/########-########-####-############/ to host-#### (#.#.#.#) in pool resgroup-####with ds ds:///vmfs/volumes/########-########-####-############/ with migId 394391#####4980737 with fault vim.fault.QuestionPending: as Operation: Local-VC_DRS_NonMM_ComputevMotion--> text = "msg.hbacommon.locklost:The lock protecting '<VM_NAME>.vmdk' has been lost, possibly due to underlying storage issues.
Due to the storage issues the migrations failed but once the storage was available once more, the pending register tasks succeed on the hosts and they registered the VM to each of them
vCenter then will attempt to get information about the VM state which the hosts can't provide and cause hostd to become inconsistent
vpxd triggering tasks to unregister the VM from one or more hosts:
<TIMESTAMP> info vpxd[09735] [Originator@6876 sub=InvtVm opID=HB-host-####@17830-#########] Unregister discovered VM (vm-####, ds:///vmfs/volumes/########-########-####-############/<VM_NAME>/<VM_NAME>.vmx) based on URL. Current host : <HOSTNAME1>, Host where it was found: <HOSTNAME2>
These unregister tasks trigger faster than hostd can attempt them
Clean up the multi-registered VM from vCenter and all ESXi - note this is to unregister it from the ESXi hosts and remove from inventory on vCenter; not to delete the VM from disk:
update vpx_host set enabled = 0;
For stateful hosts, the VM entry will need to be manually unregistered after reboot and before reconnecting to vCenter.
Get ID for the VM on host level:
vim-cmd vmsvc/getallvms
Unregister VM:
vim-cmd vmsvc/unregister <ID>