Hi,
I am using Vddk API to mount and manage vmdk files in C#. I am using a wrapper class from " http://communities.vmware.com/thread/193704?start=0&tstart=0 " to convert C# calls to C++ . When I try to connect to a remote vcenter server/esx host using VixDiskLib_Connect, I get the Error Code :3 – VIX_E_INVALID_ARG ie.,"One of the parameters was invalid. A direct C++ connect call works. C# connect to local vmdk works as well.
C# program that calls the connect method:
using System;
using System.Runtime.InteropServices;
namespace Connect2VMwareServer2
{
class Program
{
private static readonly uint VIXDISKLIB_FLAG_OPEN_READ_ONLY = 4;
static void Main(string[] args)
{
string libDir="C:\\Program Files (x86)\\VMware\\VMware Virtual Disk Development Kit\\";
ulong vixError = vixDisk.VixDiskLib_Init(1, 0, null, null, null, libDir);
VixDiskLibConnectParams vxConParams = new VixDiskLibConnectParams();
vxConParams.serverName = "192.168.11.40";
vxConParams.port = 902;
vxConParams.creds.uid.userName = "root"; // UPDATE with good value
vxConParams.creds.uid.password = "PASSOWRD"; // UPDATE with good value
vxConParams.vmxSpec = "moRef=3"; //UPDATE with good value, vm moid
vxConParams.credType = VixDiskLibCredType.VIXDISKLIB_CRED_UID;
IntPtr pConnection = IntPtr.Zero;
vixError = vixDisk.VixDiskLib_Connect(vxConParams, ref pConnection); // EXCEPTION OCCURS HERE ( ERROR CODE : 3 /14008)
}
}
}
I am stuck here terribly. Kindly suggest where I am going wrong. If I pass reference to vxConParams, I get the error "14008 – VIX_E_HOST_SERVER_NOT_FOUND ie., "The specified server could not be contacted.".
Regards,
Murugan