VMware Cloud Community
qc4vmware
Virtuoso
Virtuoso
Jump to solution

Search list for vCAC:HostMachine not working in workflow input vRO 7.3

Trying to use a list or dropdown for vCAC:HostSystem doesn't return any matches.  I need to leave it blank and hit enter which returns a long unsorted list.  Tree view takes forever in our environment.  I'm coding around it but this seems like a bug.

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

OK, I've some bad news. It appears the way plug-in is implemented is not compatible with the way list chooser in vRO client works, so you won't be able to use filtering capabilities of the list chooser.

The part of the plug-in code responsible for object searching assumes the query string provided by the user is an OData query. For example, the following scripting code shows how to enumerate all host machines whose HostName property is equal to AppServiceHost:

var all = Server.findAllForType("vCAC:HostMachine", "HostName eq 'AppServiceHost'");

for each (var item in all) {

  System.log(item);

}

At the same type, list chooser in vRO client is not aware of OData; it just filters by a simple text being a substring of any of the object's property values. In the above example, in the chooser you would enter AppServiceHost and expect to get the same objects returned by the scripting above.

Unfortunately, this different behavior of plug-in backend and list chooser means the filtering for vCAC objects won't work in all scenarios. If you provide an OData expression, the plug-in backend will work, but the list chooser won't; if you provide a simple string, list chooser will work but the plug-in backend won't.

For filtering to work properly, the plug-in searching code should be implemented in a bit more intelligent way - it need to detect whether the passed query is an OData expression or not (eg. by checking for some prefix or trying to parse it), and then if the query is a simple string, the plug-in can construct a new OData expression utilizing this string; for example it can check if any of the object's properties contains this string.

View solution in original post

5 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Could be a bug. Could you check server-side and client-side log files (server.log and vso.log) for errors around the time you provide some string to filter the list on and it doesn't return anything?

Also, could you confirm the exact type name? I'm not sure that there is such type vCAC:HostSystem.

0 Kudos
qc4vmware
Virtuoso
Virtuoso
Jump to solution

Sorry I meant vCAC:HostMachine

0 Kudos
qc4vmware
Virtuoso
Virtuoso
Jump to solution

There are two errors... at the bottom you'll see this:

2017-09-21 15:45:28.854-0700 [http-nio-127.0.0.1-8280-exec-12] WARN {} [VcoFactoryFacade] Unable to execute find on plugin: null

I typed in "VIEW" and the error below says Could not find a property named "VIEW".  The wording of that error sounds suspect as its a value not a property.

Here is the first error:

2017-09-21 15:45:28.853-0700 [http-nio-127.0.0.1-8280-exec-12] WARN {} [VcacPluginFactory] Unable to find items for connection 537ae28e-46f7-4589-8d36-6e07ae26b24f com.vmware.o11n.plugin.dynamicops.ServiceException: HTTP/1.1 400 Bad Request : <?xml version=undefined1.0undefined encoding=undefinedutf-8undefined?><m:error xmlns:m=undefinedhttp://schemas.microsoft.com/ado/2007/08/dataservices/metadataundefined><m:code /><m:message xml:lang=undefineden-USundefined>Could not find a property named "VIEW" on type "DynamicOps.ManagementModel.Host".</m:message><m:innererror><m:message>Could not find a property named "VIEW" on type "DynamicOps.ManagementModel.Host".</m:message><m:type>Microsoft.Data.OData.ODataException</m:type><m:stacktrace> at Microsoft.Data.OData.Query.EndPathBinder.GeneratePropertyAccessQueryForOpenType(EndPathToken endPathToken, SingleValueNode parentNode)&#xD; at Microsoft.Data.OData.Query.EndPathBinder.BindEndPath(EndPathToken endPathToken, BindingState state)&#xD; at Microsoft.Data.OData.Query.MetadataBinder.Bind(QueryToken token)&#xD; at Microsoft.Data.OData.Query.FilterBinder.BindFilter(QueryToken filter)&#xD; at Microsoft.Data.OData.Query.ODataUriParser.ParseFilterImplementation(String filter, IEdmType elementType, IEdmEntitySet entitySet)&#xD; at System.Data.Services.Parsing.RequestExpressionParser.ParseFilter()</m:stacktrace></m:innererror></m:error> at com.vmware.o11n.plugin.dynamicops.model.support.ErrorMessageParser.parse(ErrorMessageParser.java:59) at com.vmware.o11n.plugin.dynamicops.cxf.VcoODataCxfClient.doRequest(VcoODataCxfClient.java:324) at org.odata4j.consumer.AbstractODataClient.getEntities(AbstractODataClient.java:69) at org.odata4j.consumer.ex.ConsumerQueryEntitiesRequestEx.doRequest(ConsumerQueryEntitiesRequestEx.java:102) at org.odata4j.consumer.ex.ConsumerQueryEntitiesRequestEx.getEntries(ConsumerQueryEntitiesRequestEx.java:92) at org.odata4j.consumer.ex.ConsumerQueryEntitiesRequestEx.execute(ConsumerQueryEntitiesRequestEx.java:81) at com.vmware.o11n.plugin.dynamicops.model.VcacHostConnection.findItemsFor(VcacHostConnection.java:186) at com.vmware.o11n.plugin.dynamicops.VcacPluginFactory.findAll(VcacPluginFactory.java:137) at sun.reflect.GeneratedMethodAccessor5476.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at ch.dunes.vso.sdk.DirectInvoker.invoke(DirectInvoker.java:57) at ch.dunes.vso.sdk.SDKPluginFactoryInvoker.fetchAll(SDKPluginFactoryInvoker.java:107) at ch.dunes.vso.sdk.SDKFinder.fetchAll(SDKFinder.java:240) at ch.dunes.vso.sdk.SDKFinder.findAll(SDKFinder.java:211) at ch.dunes.vso.sdk.ModulesFactory.find(ModulesFactory.java:625) at com.vmware.o11n.sdk.EnhancedScriptingSDK.find(EnhancedScriptingSDK.java:116) at com.vmware.o11n.service.sdk.SdkModuleServiceImpl.find(SdkModuleServiceImpl.java:49) at com.vmware.o11n.service.factory.VcoFactoryFacade.find(VcoFactoryFacade.java:1840) at sun.reflect.GeneratedMethodAccessor944.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.vmware.o11n.service.security.AccessRightsInterceptor.invoke(AccessRightsInterceptor.java:98) at com.vmware.o11n.service.security.AccessRightsInterceptor.invoke(AccessRightsInterceptor.java:89) at com.vmware.o11n.service.webremoting.VcoDelegatingWebFacade.invokeOperation(VcoDelegatingWebFacade.java:105) at com.vmware.o11n.integration.initialization.VcoFactoryServiceFacadeProxy.invokeOperation(VcoFactoryServiceFacadeProxy.java:86) at sun.reflect.GeneratedMethodAccessor2796.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy23.invokeOperation(Unknown Source) at sun.reflect.GeneratedMethodAccessor7356.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:212) at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:39) at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78) at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114) at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:80) at org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at com.vmware.o11n.web.auth.http.TokenAuthenticationFilter.doFilter(TokenAuthenticationFilter.java:66) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:157) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.vmware.o11n.service.spring.bootstrap.SecureSerializationFilter.doFilter(SecureSerializationFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:95) at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.vmware.o11n.service.spring.bootstrap.WebRemotingActiveNodeFilter.doFilter(WebRemotingActiveNodeFilter.java:38) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

2017-09-21 15:45:28.854-0700 [http-nio-127.0.0.1-8280-exec-12] WARN {} [VcoFactoryFacade] Unable to execute find on plugin: null

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

OK, I've some bad news. It appears the way plug-in is implemented is not compatible with the way list chooser in vRO client works, so you won't be able to use filtering capabilities of the list chooser.

The part of the plug-in code responsible for object searching assumes the query string provided by the user is an OData query. For example, the following scripting code shows how to enumerate all host machines whose HostName property is equal to AppServiceHost:

var all = Server.findAllForType("vCAC:HostMachine", "HostName eq 'AppServiceHost'");

for each (var item in all) {

  System.log(item);

}

At the same type, list chooser in vRO client is not aware of OData; it just filters by a simple text being a substring of any of the object's property values. In the above example, in the chooser you would enter AppServiceHost and expect to get the same objects returned by the scripting above.

Unfortunately, this different behavior of plug-in backend and list chooser means the filtering for vCAC objects won't work in all scenarios. If you provide an OData expression, the plug-in backend will work, but the list chooser won't; if you provide a simple string, list chooser will work but the plug-in backend won't.

For filtering to work properly, the plug-in searching code should be implemented in a bit more intelligent way - it need to detect whether the passed query is an OData expression or not (eg. by checking for some prefix or trying to parse it), and then if the query is a simple string, the plug-in can construct a new OData expression utilizing this string; for example it can check if any of the object's properties contains this string.

qc4vmware
Virtuoso
Virtuoso
Jump to solution

Thanks for the information.... obviously I don't like the answer particularly since much of what we are doing in orchestrator deals with the vRA plugin inventory.  But the info is MUCH appreciated.

This also reminds me to bring up the issues with the way the inventory is displayed in vRA plugin.  Since no hierarchy is implemented the load times for large inventories can take forever.  I tried keeping it in tree view for selection but after a few minutes of just sitting there without the objects filling in I realized that was not an option either.  I wish this plugin had some additional methods for traversing the object trees particularly around the catalog resources.

Well hopefully you can make the magic happen in a new release of the plugin!  I've coded around it for now.

0 Kudos