Question

Query vCenter for a vm, without creating a subclient?

  • 7 March 2024
  • 4 replies
  • 39 views

Userlevel 5
Badge +16

I am looking to use the vmname to get the details of a vm without having to generate a subclient.

Essentially I need the 

API equivalent of this :

 

When I click preview it searches vcenter, I want the query generated and the  output of that search.

 

Thanks. 

 


4 replies

Userlevel 6
Badge +17

I wonder if this API call does what you’re asking?

https://documentation.commvault.com/v11/essential/rest_api_get_virtual_machine_browse.html

Thanks,
Scott
 

Userlevel 5
Badge +16

It’s really close, but it doesn't return the details I need.

 

Specifically what I need is the location details of the vm.

Imagine that I wanted to run a discovery against a subclient to see if the vm existed in said subclient. 

I would need to know its location.

 

Userlevel 6
Badge +17

I’m not exactly sure what you’re trying to achieve, but what about using VMware’s APIs?

Thanks,
Scott
 

Userlevel 5
Badge +16

Thats what I am doing in lieu of using the commvault api.

 

the answer is that the vmware api is garbage.

The get-vm vmware api returns everything about the vm except where it is found.

The only alternative is to loop through datacenter, cluster, and host and query for the inner loop to find the vm.

 

its really a waste of time. 

 

Reply