GurpreetKaurBab
Enthusiast
Enthusiast

vRO xPath Query

Jump to solution

Hi Guys,

I am using below xpath query to find a Virtual Machine using IpAddress, However it takes about 4-7 minutes to find a single VM ( Inventory has 5000 VMs )

Can you guys suggest me a way to fasten the response of the query If possible to a minute or an alternate way.

var ipAddress

var vms = Server.query("VC:VirtualMachine","xpath:ipAddress[contains(.,'" + ipAddress +"')]")

( vRO 7.6 ; vCEnter 6.5 )

Thanks in advance.

Regards

Gurpreet Kaur Babbar

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee

The property name should be guest.ipAddress

View solution in original post

0 Kudos
5 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Could you try to find the VM using vCenter's property collector? You can find some sample code in the workflows available in Library > vCenter > Property collector category.

0 Kudos
GurpreetKaurBab
Enthusiast
Enthusiast

Hi Ilian,

Thanks for guidance.

I tried using " Get vCenter Entities By Properties"

I filled Inputs as :

vC : choose the vCenter from PlugIn

filter : Entered the "IP ADDRESS" of a VM that resides in that vCEnter

target Type : Virtual Machine

properties : ipAddress

and I get below error :

[2019-10-11 14:07:29.319] [E] Error in (Workflow:Get vCenter entities by properties / pc.retrievePropertiesEx (item1)#46) (vmodl.query.InvalidProperty) {

   faultCause = null,

   faultMessage = null,

   name = ipAddress

Am I inputting wrong values or it is not working for IPAddresses?

Regards

Gurpreet Kaur babbar

0 Kudos
iiliev
VMware Employee
VMware Employee

The property name should be guest.ipAddress

View solution in original post

0 Kudos
GurpreetKaurBab
Enthusiast
Enthusiast

Thank You.....

It is taking just one second to find the property.

Do you also have any document or list of properties that can be used in this filter, that would be great help.

0 Kudos
iiliev
VMware Employee
VMware Employee

I don't have such a list/document, but I suppose all properties of a given managed object can be used, so you can check the official vSphere Web Services API documentation (for latest 6.7U3 and down to 5.5 version it is available at https://code.vmware.com/apis/704/vsphere​) for a comprehensive list of all managed objects and their properties in a given vCenter version.

0 Kudos