Hi,
I’m quite new to UiPath and VM-Ware automation. To start, I wanted to get a list of all VMs on my test server. Unfortunately, I get a NullReferenceException when invoking the activity “Get VM List”. This error leaves me kinda helpless, as I don’t know, what to fix. The activity is located inside a VMware Scope and it should have credentials to an account with sufficient rights.
I also installed the certificate of our VCSA, but I’m still lost on this error.
These are the properties of both, the VmWare Scope and the Get VM List activity:
This is the setup of servers we have in our company:
At this point, I suspect that the property “Folder” of the “Get VM List” activity is incorrect, but I don’t know which input would be correct. I’ve tried serveral permutations of our cluster setup, but with no success.
Hi @christian.sonntag !
Welcome to UiPath Community
I am not familiar with VM Ware Application Scope, but let’s try to look for the solution together !
Would you mind removing “@” form the username property, and try to run the code again ?
Also, it would be interesting to copy from clipboard the whole error message that is displayed so we can look for further references
removing the “@” from the username didn’t change anything. I’m using C# as my project language and the “@” sign allows me to use "" in my strings without having to escape them.
I’ve looked into the exception myself, but I didn’t get any useful information out of it. Anyways, here it is:
20.6.0-beta.93+Branch.release-v20.6.0.Sha.520fc7e20bd9baa56becf2fa30e75d1a9000a01d
Source: Get VM List
Message: An error has occurred: Object reference not set to an instance of an object.
Exception Type: UiPath.VMware.VMwareException
RemoteException wrapping UiPath.VMware.VMwareException: An error has occurred: Object
reference not set to an instance of an object. ---> RemoteException wrapping
System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.VMware.VMClients.<DisposeAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.VMware.VMwareService.<RunVMClientsAsync>d__8`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.VMware.Activities.GetVMList.<ExecuteAsync>d__28.MoveNext()
--- End of inner exception stack trace ---
at UiPath.VMware.Activities.BaseVMwareActivityWithResult`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Hi @christian.sonntag !
Indeed if when you created the project you precised C# then @ can be kept
Ok I think too that the folder path may be different. Unfortunately no more details in the logs For the folder let’s try:
ERLBVCSA/Erl<…>/Z-Cluster
or
ERLBVCSA\Erl<…>\Z-Cluster
After testing, if it does not work, would you mind opening the eventlog in windows, in the application list, if you see an interesting error message, more detailed ?
The error above lists an older community version 20.6.0-beta.93, which in itself is a bug because community versions should auto-update to the latest one.
Hi @christian.sonntag
You are only providing Folder name.
Could you please try with full path of the folder which in this case will be something like “Erl***/Z-Cluster”.
Also, could you please tell the version of UiPath.VMware.Activities package which you are using.
Hi @Anshu_Kumar
I’ve tried the full path with “ERLBVSCA/Erl…/Z-Cluster” as well as “Erl…/Z-Cluster”, with both “/” and "". No improvement. I am using v. 1.1.4 of UiPath.VMware.Activities.
@loginerror
I’ve not yet had a chance to update to version 21.4, but I will do that later today
The activity asks as input for the Folder in-argument a value that doesn’t include hosts or clusters and looks like a folders full-path, starting from the Datacenter - example: “Datacenter1/Folder1/Subfolder”
This full-path is what you see when you expand nodes in the VMware vSphere - VMs & Folders view (the one from your latest screenshot).
Okay, that did something. I changed the setting in the VMware Scope ERLBVCSA.. and the Folder to “Erl***\017-***”. That threw an exception stating it could not find the data center.
using “Erl***/017-****” ran a lot longer, but then also came back with this exception:
20.6.0-beta.93+Branch.release-v20.6.0.Sha.520fc7e20bd9baa56becf2fa30e75d1a9000a01d
Source: Get VM List
Message: Unable to retrieve Virtual Machines under "Erl***/017-****": VMware.Vim.VimException
at VMware.Vim.ViewBase.SetViewData(ViewBase currentObject, String currentPropertyPath, Dictionary`2 allowedPropertyPath, Dictionary`2 objectContentList, Dictionary`2 generatedManagedObjectList)
at VMware.Vim.ViewBase.UpdateViewData(String[] properties)
at VMware.Vim.VimClientImpl.GetView(ManagedObjectReference moRef, String[] properties)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.CreateInfo(VirtualMachine vm, String fullPath, VapiClient vapiClient)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.<>c__DisplayClass2_0.<CreateInfos>b__0(VirtualMachine vm)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.CreateInfos(VirtualMachine[] vms, VapiClient vapiClient)
at UiPath.VMware.Vim.Client.VimClient.<GetVMListAsync>d__23.MoveNext()
Exception Type: UiPath.VMware.VMwareException
RemoteException wrapping UiPath.VMware.VMwareException: Unable to retrieve Virtual Machines under "Erl***/017-****": VMware.Vim.VimException
at VMware.Vim.ViewBase.SetViewData(ViewBase currentObject, String currentPropertyPath, Dictionary`2 allowedPropertyPath, Dictionary`2 objectContentList, Dictionary`2 generatedManagedObjectList)
at VMware.Vim.ViewBase.UpdateViewData(String[] properties)
at VMware.Vim.VimClientImpl.GetView(ManagedObjectReference moRef, String[] properties)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.CreateInfo(VirtualMachine vm, String fullPath, VapiClient vapiClient)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.<>c__DisplayClass2_0.<CreateInfos>b__0(VirtualMachine vm)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at UiPath.VMware.Vim.Extensions.VirtualMachineExtensions.CreateInfos(VirtualMachine[] vms, VapiClient vapiClient)
at UiPath.VMware.Vim.Client.VimClient.<GetVMListAsync>d__23.MoveNext()
at UiPath.VMware.Activities.BaseVMwareActivityWithResult`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
The path should be specified as “Datacenter/folder1/folder2/…"
Try using Get VM and set a value for VirtualMachineName parameter (i.e. The full path of the virtual machine including the datacenter and folder). Does it work?
Getting a VM by name also failed with this exception:
20.6.0-beta.93+Branch.release-v20.6.0.Sha.520fc7e20bd9baa56becf2fa30e75d1a9000a01d
Source: Get VM
Message: Unable to find Virtual Machine with name "Erl****/017-***/017_CISHMIPAx64"
Exception Type: UiPath.VMware.VMwareException
RemoteException wrapping UiPath.VMware.VMwareException: Unable to find Virtual Machine with name "Erl****/017-***/017_CISHMIPAx64"
at UiPath.VMware.Activities.BaseVMwareActivityWithResult`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
I’ve tried also the Get VM activity using the VMs ID 6ad66c42-901b-48b6-a644-6cb4ab847780 (which I think is correct, I got it from the URL of my V-Center):
It doesn’t matter that the VM is powered of, does it?
I have also installed the certificate, even re-installed it. I noticed that I only have one *.crt file instead of the two shown in the documentations GIF. Could that be an issue?