Hi !
I'm using c++/clr so I can do the Soap communication like done in the c# examples of the sdk and also can use the functions from the VDDK. I initialize the vixdisklib with Version number 5.0. I communicate directly with the esxi host which is 5.1. I'm using the VDDK 5.1.1.
I have the situation where QueryChangedDiskAreas crashes with a SoapException. No idea why, but it works for all my other vms. There is nothing Special I can think of - besides even if there was, that function should probably return a nice error instead of crashing my application.
The error message is this:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in System.Web.Services.dll
Additional information: Error caused by file /vmfs/volumes/51e943ed-ce941e40-4ad9-0040d0c00047/freeDos/freeDos.vmdk
It's a freeDos vm, so I have a small vm for testing.
Any ideas what could cause this or how I could work around it?
I'm not sure what other Information could be helpful for you. Maybe the order in which I do things, because I'm not really sure it is correct:
SoapConnect
vmConfigInfo => check if cbt is on, if not turn it on
VixDiskLib_InitEx(5, 0, &lognormal, &logwarn, &logpanic, NULL, NULL);
VixDiskLib_PrepareForAccess(&connectParams, "MyApp"); // I set vmxSpec to moref=[vmname]. Is this correct? I found locations where they put moid=[some nnumber] there.
vixError = VixDiskLib_ConnectEx(&connectParams, TRUE, NULL, NULL, &srcConnection); // I set vmxSpec to 0 here. If I let the moref=[vmname] in here, Open later on fails.
createSnapshot
VirtualMachineConfigInfo ^ vmSnapConfigInfo = (VirtualMachineConfigInfo ^)svcutil->GetDynamicProperty(snapmor, "config");
extract the devicekeys of the devices I want to backup from the info above
VixDiskLib_Open(srcConnection, snapshotdisk->filename, VIXDISKLIB_FLAG_OPEN_READ_ONLY, &diskHandle);
VixDiskLib_GetInfo(diskHandle, &info);
svc->Service->QueryChangedDiskAreas(vmmor, snapmor, snapshotdisk->devicekey, position, changeidprev); // changeidprev is "*" in my case; ==> here it crashes
// theoretically continue like this:
VixDiskLib_Close(diskHandle);
removeSnapshot(snapmor);
VixDiskLib_Disconnect(srcConnection);
VixDiskLib_EndAccess(&connectParams, "MyApp"); // again, vmxSpec is set to moref=[vmname]
VixDiskLib_Cleanup(&connectParams, &numcleanedup, &numremaining);
VixDiskLib_Exit();
SoapDisconnect
Thx
intripoon