VMware Cloud Community
crago
Contributor
Contributor

vCO equivalent of PowerCLI Get-View

Has anyone found / know of a vCO equivalent to the following PowerCLI command:

Get-View -ViewType VirtualMachine -Filter @{"Config.Template"="True"}

I've tried using the VcSdkConnection.getAllVirtualMachines() method, but all I'm able to do is return all VMs and then loop through each of them to test if config.template = true which can take several minutes.

Thanks,

Deric

Thanks, Deric
0 Kudos
4 Replies
tschoergez
Leadership
Leadership

Hi!

The good: It should be possible, by appending a filter to the getAllVIrtualMachines()-method

The bad: I don't know how... (maybe sneaking into the JAVA toolkit may help, Steve Jin ' s book about the vSphere SDK is a great start)

The ugly: no information by anybody in Orchestrator yet (see also my question in http://communities.vmware.com/message/1607625 )

Cheers,

Joerg

0 Kudos
Andreas_Diemer
Enthusiast
Enthusiast

Hi Deric,

it looks like that in PowerCLI a simplified PropertyFilterSpec and XPath is used. I will build a PropertyFilter for this, but this will take a little time (i have to learn it for myself Smiley Happy ). The initial hint i found in (page 20).

I'll be back soon...

-


Regards,

don't forget: award points to helpful answers

visit &

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos
crago
Contributor
Contributor

Hey Andreas,

thanks for looking into this. I was under the impression that the PropertyFilter was actually applying a filter to each result, as in, return the following fields for each result instead of filtering the results set based on the PropertyFilter. So instead of returning just the results that matched the filter, it would instead return all the results, but only the properties of each result that matched the filter.

Thanks, Deric
0 Kudos
Andreas_Diemer
Enthusiast
Enthusiast

Hi Crago,

I just post Joerg (http://communities.vmware.com/thread/284052?tstart=0) about my expiriences so far. Just follow the link so you can read what Joerg has found. Unfortunately the results are very unsatisfactory :smileycry:.

Regards, Andreas

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos