RESTful knowledge exchange
Post Reply
paulmcnally
Service Provider
Posts: 14
Liked: never
Joined: Feb 26, 2020 10:19 am
Full Name: Paul McNally
Contact:

How to query resource pool for replica VM's (full name with suffix)

Post by paulmcnally »

Hi, I'm trying to figure out how to use the lookup or query functionality to get a list of VM's in a resource pool.

I believe that veeam creates a resource pool for the hardware plan of the format [Hardware plan]_[Tenant Name] and the replicated VM's appear under that in VMWare, with a customer generated suffix on failover.

I'm trying to get the names of the VM replicas on VMWare in the hardware plan.

If I use lookup:

Code: Select all

/api/lookup?host=urn:veeam:HierarchyRoot:554cac72-2924-4b92-90c5-65a3cdb70086&name=*&type=Vm
This will list all the VM's, and the suffixes (e.g _replica) that I need in order to target the Vm on VMWare.

Code: Select all

+"HierarchyItems": array:1 [▼
    0 => {#312 ▼
      +"ObjectRef": "urn:VMware:Vm:554cac72-2924-4b92-90c5-65a3cdb70086.vm-7396"
      +"ObjectType": "Vm"
      +"ObjectName": "Clifford Home_cockpit-01_replica"
      +"Type": "HierarchyItem"
    }
  ]
What I need to be able to do is say "Give me all VM's in resource pool XYZ"

Please can someone help me generate this query?

Thanks

veremin
Product Manager
Posts: 17760
Liked: 1620 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to query resource pool for replica VM's (full name with suffix)

Post by veremin »

What if you identify tenant's replica a bit differently? Not by Hardware Plan Resource Pools, but by VM replica names? The approach is described here, might be worth checking. Thanks!

paulmcnally
Service Provider
Posts: 14
Liked: never
Joined: Feb 26, 2020 10:19 am
Full Name: Paul McNally
Contact:

Re: How to query resource pool for replica VM's (full name with suffix)

Post by paulmcnally »

Thank you so much! :D :D That worked brilliantly!

All I needed was a wildcard on the tenant name, simple when you know how! :D

Code: Select all

GET http://localhost:9399/api/lookup?host={hostUID}&name=TenantName_*&type=Vm

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest