We had been experiencing intermittent crashes the Vix API. We recently switched to launching vmrun.exe in a subprocess instead so the Vix API crashes would not kill our application. We have found that vmrun.exe also crashes intermittently. It displays a fatal error popup and hangs. It is very inconvenient since we are trying to control VM operations automatically and unattended. The crashes occur most often when we're reverting to snapshots or starting VMs. The crashes are more frequent when we launch multiple instances of vmrun.exe on the same computer at the same time, each to control a different VM.
The popup looks like this:
Here is the full problem signature:
Problem signature:
Problem Event Name: APPCRASH
Application Name: vmrun.exe
Application Version: 1.10.1.12915
Application Timestamp: 4c1310f0
Fault Module Name: glib-2.0.dll
Fault Module Version: 2.16.4.0
Fault Module Timestamp: 48801db1
Exception Code: c0000005
Exception Offset: 0005a870
OS Version: 6.1.7600.2.0.0.274.10
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Every time I've seen this, I found a bug in the software. VixCOM is very unforgiving. You need to close all unclosed handles when you're done with them. I recommend you use a library, everything that's IDisposable needs to be disposed via a using pattern and you won't see a crash.
http://I work with pknut. He posted the problem description for me.
We switched from calling the Vix API to launching vmrun.exe precisely to eliminate the possibility that a bug in our code is causing the crashes. Our application no longer references VixCOM. It performs all VM operations by launching vmrun.exe. The posted popup and problem signature are of vmrun.exe, not an application that we wrote. This particular crash was produced by a simple batch file that invokes vmrun.exe to perform 'reverttosnapshot' and 'start' operations in a loop.
I figured that I bet that vmrun is having the same types of issues since a lot of the stuff is still going through the COM layer and gets pooled. If you went back to using the C# / COM interface and disposed things you'd probably be better off.
Is there any way you could upload the script your are using that results in the crash?
Also, which version of VIX are you using, and what version of which VMware product are you using it with?
Actual, vmrun does not use the COM library, since we wrote it directly on top of the C API (works on both Windows and Linux and actually vmrun was written before VixCOM).
So, it should have fewer of those issues you describe, since it has only uses normal reference counting, not reference counting on top of garbage collection.
We're getting the crashes in this environment:
Windows XP Professional SP 3
VMware VIX 1.10.1.12915
vCenter Server 4.1.0 Build 258902
ESXi 4.0.0,261974
I run the batch file in a Command Prompt with the VMX path as an argument. The crashes may be more frequent when I run three copies to control three different VMs simultaneously, but we get crashes even if we only run one copy.
@echo off
:loop
echo revertToSnapshot...
"c:\program files\vmware\vmware vix\vmrun.exe" -T esx -h https:// start %1 gui
echo returns %ERRORLEVEL%
goto :loop
Hi,
Did you get any solution for this problem? I am facing the same issue with powershell, whenever I am trying to execute Invoke-VMScript command. The issue is not consistent.
Thanks,
Meena
We never got a solution. We work around it by running vmrun.exe repeatedly until it succeeds, constantly monitoring it for hangs and program failure popup dialogs (in which case we kill the process). I am not working on that project any more, so I have not checked lately whether newer versions of the Vix API or vmrun.exe behave better...but I am not optimistic.
This happens in our environment as well and we ended up with the same workaround. I upgraded to VMWare 10 recently and found the popup message changed a little, causing our workaround of closing the popup and retrying no longer functional. Very annoying, inconsistent, and problematic due to instability. We are now updating to catch and close the new popup ("VMWare Workstation unrecoverable error: (VMZ) Revert to snapshot # failed. A log file is available in ....").
I believe the lesson here is to stop using VIX for interfacing with vSphere, and instead, use the vSphere API.
Ah nevermind what I just said. I noticed you were using ESXi 4