community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

How to find a guest on many linked mode vcenters?

Open joaoolavobv opened this issue 3 years ago • 3 comments

SUMMARY

My company has many vcenters, all connected on liked mode. This way, from a single vcenter web interface, I can search for a guest and it will be found, no matter on which vcenter it is hosted.

Is there a way to use vmware_guest_find (or other component) to use a single vcenter on 'hostname' parameter and search across all linked vcenter?

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

community.vmware.vmware_guest_find

ANSIBLE VERSION

2.12

joaoolavobv avatar Jul 20 '22 16:07 joaoolavobv

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Jul 20 '22 16:07 ansibullbot

I don't think any of our modules works with linked vCenters. I think the vCenter API doesn't even allow to search for objects in linked vCenters.

The only solution I see at the moment is to iterate over all your vCenters. Bonus: Works even for vCenters that are not linked.

mariolenz avatar Jul 21 '22 16:07 mariolenz

On powercli, you first have to make connect on each vcenter. Then, do a search on only one of them and this way the guest is searched and find across all vcenters. Nothing similar, I guess, right? So, should I open a new feature request?

joaoolavobv avatar Jul 21 '22 19:07 joaoolavobv

I don't find a way to implement this in the official vSphere API, so I'll close this issue for now.

I'm sorry, but we can't implement what the API doesn't support. BTW: PowerCLI is special because it's from VMware and seems to use (some) private / undocumented APIs.

mariolenz avatar Oct 24 '22 17:10 mariolenz