PowerShell script exchange
Post Reply
Silent
Novice
Posts: 8
Liked: never
Joined: Jan 23, 2025 10:55 am
Full Name: Silent
Contact:

List VMs in VBR

Post by Silent »

Hello,

I'm trying to obtain a list of VMs that my connected hypervisor in VBR has.
For VMware you can use Find-VBRViEntity - this works well.
Now.. I got other hypervisors connected to a VBR server - this regards Proxmox and Nutanix.
These hypervisors work with VBR, they do backup, show VMs etc. in VBR GUI (Inventory -> Virtual Infrastructure).
Since there is no Powershell command for getting the list of VMs on those hypervisors I am looking into static methods. (I'm aware that these are not supported)

This is the path where the plugins for "PVE" (Proxmox) and "Nutanix AHV" are located in:
C:\Program Files\Veeam\Plugins

The Proxmox extension looks like it can be of help to add the assembly to Powershell for using methods/classes from it:
Veeam.Backup.Extensions.Proxmox.dll
Class: CInfrastructuresProvider
Methods: GetHierarchyAllVirtualMachines , GetVmsHierarchyView

(similar to getting ALL backup jobs using [Veeam.Backup.Core.CBackupJob]::GetAll() from VBR)

Did anyone figure out how to retrieve the VMs hosted by the connected hypervisor that is connected to VBR or can at least contribute?
david.domask
Veeam Software
Posts: 2736
Liked: 629 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: List VMs in VBR

Post by david.domask »

Hi Silent,

I've not tried to poll for this information, but I'm going to guess you'll hit a wall trying to go through the extensions DLLs -- I have not tried it, but just have a feeling we'll hit a dead-end with .net reflection.

I will try to find a way a bit later, I suspect we'll need to go through [Veeam.Backup.DBManager.CDBManager]::Instances to find this, I'm just not sure what instance it's under at the moment.

Will update once I get a chance to poke around in this class.
David Domask | Product Management: Principal Analyst
Silent
Novice
Posts: 8
Liked: never
Joined: Jan 23, 2025 10:55 am
Full Name: Silent
Contact:

Re: List VMs in VBR

Post by Silent »

Hi David,
thank you for looking into this.
About the .NET reflection - sending a command (e.g. Get-VBRLicense) and piping it to Out-Null does load all .NET dependencies so the static methods from DLLs work.
I scoured the named DLL but the classes/methods I found and tried did not result with the information I'm trying to get - just wanted to ask for some hive intelligence and hopefully an answer or at least a hint that points me towards the right direction.
I'll have another run at it but will also be looking forward hearing from you!

PS: A few weeks back when I was looking into this very actively I stumbled upon some methods that contained "cache" in their names - there were 3 functions in total which were related to each other.
I need to look it up again but I guessed that it could be of help.
What I can remember is that I figured out that Veeam B&R talks to the Proxmox API and queries VMs etc. and "caches" that information in VBR. <- that's where I need to step in and fetch some infos for my project. Otherwise I need to write an API handler for each product which you guys already have done so I can rely on your expertise and work.
david.domask
Veeam Software
Posts: 2736
Liked: 629 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: List VMs in VBR

Post by david.domask »

You're welcome, though regrettably I must tell I was not able to make any headway. The non-VMware and HyperV hypervisors are connected via a specific API and VBR queries this API in the background to pull information from the connected hypervisors, and you're correct there is some local caching done to avoid constantly polling the hypervisors.

However, I'm not really able to find a way to poll this at this time via static methods.

Unfotunately here we'll need to wait until we have full support via our automation endpoints for Proxmox, Nutanix, etc., I'm not sure we're going to find a manageable solution even with unsupported methods.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests