When a VM is unassigned from a host, a tomaintenance request is processed. This should remove the VM from the host. There are cases where this may fail such as if the VM resides on a datastore other than what is configured in the vmprofile for the host.
If a VM is still running, the only check done is an attempt to login via SSH from the management node. If this fails, it is assumed the VM is not running. An additional ping check should be done.