NullReferenceException when trying to get VM List

Yes, both with “/” and “” did cause the exception

@Forum_Staff do you have an idea of how we should deal with the situation ?

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.

First suggestion would be to install the latest 21.4 version, see here:
How to fix your Studio installation / Licensing issues

1 Like

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.

Thanks

1 Like

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

@christian.sonntag please change to the view indicated in the screenshot below and see there the folder structure you have for your datacenter.
image

Hi @ovidiuponoran,

in that view, the “Z-Cluster” entity is not shown:

What does that mean?

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).

As a helper, you can take a look at:

  1. VMware sample video that includes GetVMsList Automate VMWare Activities with UiPath - YouTube
  2. VWware sample workflow guide (skip to How to use, step 5.) IT Automation Activities for VMWare

In VMware Scope activity, ServerAddress should something like “ERLBVCSA.abc.com
In Get VM List the Folder = “Erl…/013-…”

You need to provide a virtual machine folder as displayed in that second view.

image

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?

Make sure you had installed the trusted root CA certificates from your vSphere on the machine where the Robot is running. See documentation: https://docs.uipath.com/activities/docs/vmware-scope

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?

@christian.sonntag

I don’t know why you have only one certificate.
I’ve just tested in another environment where I had 3 certificates (*.crt files) to install.

BTW, in your screenshot, the VM id is “vm-8373”

In my test environment, I’ve created a similar folder structure with yours and everything works fine.
image

Using the id “vm-8373” also didn’t work.

These are the certificate files I download from out V-Center:
image

@andreioros my guess is there are some programmatic-access permissions that are missing. Can you provide some info about this?

@christian.sonntag are you using in the VMwareScope activity the same credentials that you used to authenticate in the vSphere browser client?

Can you please check if Get Host List activity works for you?

@andreioros Yes, I do use the same credentials

@ovidiuponoran Get Host List works :smiley: I receive one host in the array of hosts, with an ID and the IP of my Z-Cluster (i.e. 10.162.43.190)

If the credentials are the same, it’s not a rights issue.

GetHostsList doesn’t need the certificates and it working is a good sign - please make sure you’ve downloaded the certificate from the vcenter (as shown in the image below) and installed them as shown at https://docs.uipath.com/activities/docs/vmware-scope#additional-prerequisites

I already installed the certificates like shown in the documentation. But I’m having one less file than shown in the GIF:
image

I have rebooted the machine and checked the certificate in the browser. it seems to be OK there, but I still get an exception in UI Path…