vim-cmd vmsvc/unregister <VM-ID>, the following error is observed:The attempted operation cannot be performed in the current state (Powered off)VMware vCenter Server 8.0.x
VMware vSphere ESXi 8.0.x
The vMotion tasks remain in a hung state in the target vCenter, leaving the VM processes running on the target ESXi hosts and thereby preventing the deletion of the stale VMs.
1. Cancel the stuck vCenter tasks by restarting the vCenter services (Refer to Knowledge Base article Clear stale tasks from the vCenter "Recent Tasks" panel for details)
service-control --stop --all && service-control --start --all
2. Kill the stale VM processes on the target ESXi hosts (Refer to Knowledge Base article Unable to unregister virtual machine showing power off status in ESXi 8 for details)
esxcli vm process list | grep -B10 -ie '<VM-NAME>'
esxcli vm process kill --type=soft --world-id=<World ID>
3. Delete the stale VMs from the target ESXi hosts and target vCenter if they still exist
4. Initiate the cross-vCenter vMotion for the VMs again