I am experimenting with running automated tests on a VMWare VM. Opening and powering on the VM (through VIX API), as well as running the test tool, is all controlled from the VMWare host (same physical machine). After the tests have been run I would like to use VIX API to revert to "Snapshot 1", i.e. the state my VM was in before the tests were run. However, I get the error code and message "15 The file is already in use.".
When I do this manually on the VM, it is automatically restarts and I am back at "Snapshot 1" state but, if I do it using VIX API RevertToSnapshot from the VMWare host, I get the message above and the VM gets suspended. If I select to "Resume...." (manually) then I am back at "Snapshot 1" state. Any idea what is wrong? Why does the VM not restart automatically when I use VIX API?
It sounds like a bug in your code. The only thing I can think about is that you're trying to reconnect to the host a second time and something goes wrong there. I definitely do this kind of scenarios all over the place and it hasn't been an issue.
Sorry, I should have replied that I found the solution under Remarks for the RevertToSnapshot method. "When you revert a powered on virtual machine and want it to display in the Workstation user interface, options must have the VIX_VMPOWEROP_LAUNCH_GUI flag".
