I just upgraded my server to version 2.0 and my vix client to version 1.5. My vb.net code that was previously connecting properly now gets permission problems.
"Insufficient permissions in host operating system"
I'm using the same logon and userID that I use for the web access on port 8333. Does anyone have any suggestions for getting past this problem?
Here's the routine that was working for VMWare Server 1.0.x with Vix 1.1.
Public Sub New(ByRef hostname As String, ByRef userid As String, ByRef password As String, ByRef vmxFile As String)
Dim job As VixCOM.IJob
Dim vix_status
job = vixlib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, _
"https://" & hostname & ":902/sdk", 0, userid, password, 0, Nothing, Nothing)
Dim results = Nothing
Dim props() As Integer = {VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE}
vix_status = job.Wait(props, results)
If vixlib.ErrorIndicatesFailure(vix_status) Then
Dim VixException As New Exception("Connection to VMWare server '" & hostname & "' failed with exception '" & vixlib.GetErrorText(vix_status, Nothing) & "'")
Throw VixException
End If
host = results(0)
job = host.OpenVM(vmxFile, Nothing)
vix_status = job.Wait(props, results)
If vixlib.ErrorIndicatesFailure(vix_status) Then
Dim VixException As New Exception("Open of '" & vmxFile & "' failed with exception '" & vixlib.GetErrorText(vix_status, Nothing) & "'")
Throw VixException
End If
vm_vmx_file = vmxFile
vm = results(0)
End Sub
Probably
[standard] test104/xpbase.vmx
You should be able to see the name via the UI , though it may be buried in some config screen.
You need to change the hostType from VIX_SERVICEPROVIDER_VMWARE_SERVER to VIX_SERVICEPROVIDER_VMWARE_VI_SERVER in the Connect() call.
Thanks for the quick reply.
That gives me a return code of 26 in vix_status. The text is "Unable to connect to the host".
You're using 902 as the port in the URL. Try 8333.
I'm back to vix_status = 3014
"Insufficient permissions in host operating system"
My user is setup on the host just as it was with VMWare Server 1.0.x. Is there a log or something I could check on my server?
That means it doesn't like the username/password you passed in the Connect() call. Its validating it against the host that Server is running on.
The interesting logs are in C:\Documents and Settings\All Users\Application Data\VMware\VMware Server\hostd*.log or /var/log/vmware/hostd/hostd.log (depending on theOS Server is using). Though in this case its probably just going to show a login fault.
I'm good to go. I had changed a forward slash to back slash while trying to debug. I changed it back and everything works as advertised.
The suggestion to change the service provider and port got me over the hump.
I'm erroring on the OpenVM command now. Again, this command worked with the older release of VMWare server. Is there something special about the formatting of the filename for VMWare Server 2.0?
Yeah, Server 2 uses the ESX style of naming VMs, with the datastore as part of the name, rather than a basic filepath.
So instead of "/path/to/vm.vmx", you'd use something like "[storage] path/to/vm.vmx".
This affects Open(), Register and Unregister()
I've guessed a few times and I'm not having any luck.
My data store is named "standard". The data store is the "e:\virtual machines" directory.
The image that I want is "e:\virtual machines\test104\xpbase.vmx".
What should my ESX style name be?
I've tried several combinations
standard\test104\xpbase.vmx
Probably
[standard] test104/xpbase.vmx
You should be able to see the name via the UI , though it may be buried in some config screen.
That did it
Thank you so much for the help
I'm experiencing the same problem connecting but via COM.
mmedlin: can you please provide details what fixed it in your case? You have mentioned something about replacing slashesh, can you please provide the exact format?
Thanks!
Which version of VMWare Server are you using? Do you need an example of the Connect or the OpenVM command?