VMware {code} Community
dblock
Enthusiast
Enthusiast

Bug? RevertToSnapshot fails with "file already in use"

We've had a VMWareTasks thread on this.

Maybe it's a bug in VixCOM: RevertToSnapshot will fail with "file already in use" on VMWare workstation (both 6.x and 7.x) when you pass VIX_VMPOWEROP_NORMAL and try to revert a Live (powered on) snapshot. I think VIX_VMPOWEROP_NORMAL is meant to figure out what kind of power-on state to bring the snapshot to, so looks like a bug to me.

There's a workaround to use any other flag, both VIX_VMPOWEROP_LAUNCH_GUI and VIX_VMPOWEROP_SUPPRESS_SNAPSHOT_POWERON produce expected results - but it's not always possible to know upfront what state your snapshot is in.

0 Kudos
2 Replies
stanguturi
VMware Employee
VMware Employee

Same issue is reported few weeks back. Check the post: http://communities.vmware.com/message/1431010

Check comments by lemke in that post. As you suggested in your comment, using VIX_VMPOWEROP_LAUNCH_GUI will work.

This error may be fixed in future releases.

-Thanks

Sankar.

admin
Immortal
Immortal

The problem is when VixCOM (well, VIX in general) tries to power on the VM after performing the disk-level revert. Just like VixVM_PowerOn(), powering on the virtual machine with the VIX_VMPOWEROP_NORMAL option while the virtual machine is open in the UI will report this error.

Just like VixVM_PowerOn(), the solution here is to use VIX_VMPOWEROP_LAUNCH_GUI. It is important to be consistent about whether the VM should be in the UI or whether it should be running headlessly (in the back ground).