PowerShell script exchange
Post Reply
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Find-VBRViEntity not returning any VMs

Post by masonit »

Hi

Can't understand what the issue is. Shouldn't below code return vm info? It only returns host info about the defined host.

Find-VBRViEntity -VMsAndTemplates -Server (get-vbrserver -name "host")

or

get-vbrserver -name "host" | Find-VBRViEntity (does not mather what parameter I define here, always only host info returns)

\Masonit
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Got it working now. Instead of specifying host (esxi) I specified vcenter instead and then it returns VMs. I was reading in "Veeam Backup PowerShell | Reference | REV 2" about the cmdlet and I think the info there is very misleading. I got the impression that you only could specify host (esxi) and not vcenter when using Find-VBRViEntity.

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

You could specify single host, as long as it's added as standalone server and is not located under already added vCenter server. Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Is it parameter: Reference from Find-VBRViEntity, that is used by vbr when a vm is added to a backup job? Maybe in conjuction with vcenter / host id?

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

Not sure whether I follow you on that. Find-VBRViEntity cmdlet allows you to find VMware objects. It finds it on the specified vCenter or ESXi server.

vCenter or ESXi server can be returned by Get-VBRServer cmdlet. ESXi server is returned only when there are is vCenter server added to backup console that manages it.

Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Yes when I find a vm with Find-VBRViEntity there is a parameter called Reference. I wonder if that is the unique key Veeam uses when a vm is connected to a vbr job?

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

Nope, it uses different parameter - Id.

But can you clarify what you're trying to achieve, may be there is an easier way to do that?

Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

I want to compare data from virtual environments with data from Veeam. To be able to see what vms we don't have backup on. I want to compare using the same unique key Veeam uses instead of for example vm name.

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

Have you seen this report? Check "VMs with No Successful Backups within RPO" section, seems to be exactly what you're looking for. Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Hi

Thanks. But not what I am looking for. :)

Could you please answer my unique key question?

\Masonit
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by jhoughes »

You want to compare the 'Reference' property returned from Find-VBRViEntity to the 'Id' property that you get from Get-VM (also under ExtensionData.Summary.Vm).
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Thanks!

If I compare id from get-vm with Reference from Find-VBRViEntity. They are not the same. Why is always "VirtualMachine-" removed from Reference?

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

The referenced script checks your virtual infrastructure, finds VMs that have not had successful backup within the defined period and notifies you about that. This seems to be something you're after.

If the script does not work for you, then, you need to construct unique VM identifier yourself (by adding VirtualMachine to Reference property or something) and compare it with the Id returned by PowerCLI cmdlet.

Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

Yes, but I will not create an report. Result of comparison will be used in further automation.

After looking at "ExtensionData.Summary.Vm" its more clear. Where "VirtualMachine-" is marked as type.

Thanks.

\Masonit
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by masonit »

When doing my comparison between vm and veeam data. What would be prefered way of getting vm data? With get-vm (powercli) or using Find-VBRViEntity? Is data from Find-VBRViEntity in any form filtered? Or is data from get-vm (powercli) or using Find-VBRViEntity pretty much the same? (except less properties from Find-VBRViEntity)

\Masonit
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find-VBRViEntity not returning any VMs

Post by veremin »

Yes, but I will not create an report. Result of comparison will be used in further automation.
Then, disregard report creation portion and make use of the comparison results.
When doing my comparison between vm and veeam data. What would be prefered way of getting vm data? With get-vm (powercli) or using Find-VBRViEntity? Is data from Find-VBRViEntity in any form filtered? Or is data from get-vm (powercli) or using Find-VBRViEntity pretty much the same? (except less properties from Find-VBRViEntity)
Pretty much the same. You can rescan the given vCenter within the script first to make sure Find-VBRViEntity operates with the latest information.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests