Patent ID: 8910161

Claim:
A method for scanning a virtual machine (VM) running on a host computer, the method comprising: upon a restarting of the VM or a completion of a migration operation of the VM, determining whether the VM has a scan token stored within a context of the VM, the scan token containing a value associated with an ongoing scan operation for the VM at a time of suspension or migration of the VM; when it is determined that the VM has the scan token, determining whether a corresponding scan token for the VM is present and current in a storage location outside the context of the VM; causing the ongoing scan operation to resume when the corresponding scan token is present and current in the storage location; causing the ongoing scan operation to be canceled when it is determined that the corresponding scan token is not present, or if the corresponding scan token is present, that the corresponding scan token is not current; and determining from information contained in the storage location regarding the corresponding scan token that the ongoing scan operation completed prior to a rollback and the restarting of the VM, and in response to the determining that the scan operation completed, canceling the ongoing scan operation.