First of all, we are not supposed to cancel certain tasks such as move, copy, SvMotion, snapshot creation/deletion, etc. due to obvious reasons. If you are moving a disk using the ESXi host client, you can cancel the task from the ESXi command line as below -
Step-1 - Identify the task ID -->
[root@esxi-1:~] vim-cmd vimsvc/task_list
(ManagedObjectReference) [
'vim.Task:haTask--vim.VirtualDiskManager.moveVirtualDisk-15130'
*Task name for moving a file would be - haTask--vim.FileManager.moveFile-xxxxx*
Step-2 - Cancel the task -->
[root@esxi-1:~] vim-cmd vimsvc/task_cancel haTask--vim.VirtualDiskManager.moveVirtualDisk-15130
If the task does show as cancelled in the GUI after a few minutes, restart the management agents of the host to cancel all the ongoing tasks.
Please consider marking this answer as "correct" or "helpful" if you think your questions have been answered.
Cheers,
Supreet