Symptoms:
Trying to remove or unset the coredump file fails with error:
Unlink of file /vmfs/volumes/<DatastoreName>/vmkdump/####.dumpfile failed: Device or resource busy.
When you run one of these commands, it fails to unlink or remove the core dump:esxcli system coredump file -u
esxcli system coredump file remove -f /vmfs/volumes/<DatastoreName>/vmkdump/####.dumpfile
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x
This issue occurs when another ESXi Host in the environment has an exclusive (Mode 2) lock on the dumpfile.
To resolve this issue identify the host which is holding the lock on the dumpfile and remove it from that host.
vmfsfilelockinfo -p /vmfs/volumes/<DatastoreName>/vmkdump/####.dumpfile
Open a SSH session to the ESXi host that holds the lock.
esxcli system coredump file list
Un-configure the dumpfile by running this command: esxcli system coredump file -u
Disable and delete the currently configured coredump file:esxcli system coredump file set --enable false
esxcli system coredump file remove -f /vmfs/volumes/<DatastoreName>/vmkdump/####.dumpfile
Note: On older ESXi version, the command 'vmfsfilelockinfo' is not available. In this case use vmkfstools to get the UUID of the ESXi Host which holds the lock.
Example: vmkfstools -D /vmfs/volumes/<DatastoreName>/vmkdump/####.dumpfile