My Veeam Report v9.0.1

PowerShell script exchange

My Veeam Report v9.0.1

Veeam Logoby Backerupper » Tue Feb 16, 2016 10:52 pm 2 people like this post

The latest My Veeam Report for VBR v9 has been released

http://blog.smasterson.com/2016/02/16/v ... rt-v9-0-1/

Highlights include:
    VBR v9 support
    Simplified repository info gathering
    Updated Get-VMsBackupStatus to remove obsolete cmdlet warning
    Ability to run from system with 'console only' install

Big thanks to tsightler for all his help as well as to Veeam for adding the total/free space properties to the repository info!
Backerupper
Enthusiast
 
Posts: 42
Liked: 10 times
Joined: Fri Dec 28, 2012 2:32 pm

Re: My Veeam Report v9.0.1

Veeam Logoby tsightler » Wed Feb 17, 2016 12:14 am

I really like this report. In looking for optimizations I noticed that you already have a nice variable that contains all backup sessions so it would be possible to get rid of the additional call to Get-VBRBackupSession in the Get-VMsBackupStatus function, just replace:
Code: Select all
$vbrtasksessions = (Get-VBRBackupSession |
    Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-$script:HourstoCheck)}) |
    Get-VBRTaskSession | Where-Object {$_.Status -ne "Failed"}

With
Code: Select all
$vbrtasksessions = $allSesh |
    Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-$script:HourstoCheck)} |
    Get-VBRTaskSession | Where-Object {$_.Status -ne "Failed"}

Because the call to Get-VBRBackupSession is one of the heaviest, this can cut the run time significantly. It was a >20% reduction in run time (48 seconds reduced to 37 seconds) just in my lab. I imagine it could save even more in larger environments.

As just a generic comment, as the original author of the VM status function, I think it would be a good idea revisit it and improve this logic a little more as this could easily miss jobs that are still running and have backed up some VMs but not others. Right now if a job is actively running the status of all VMs in that job are ignored. I think it would probably be better to grab all backup sessions from perhaps 2x the SLA, then get only tasks sessions that have both started and ended within the SLA without failed status. That should give a far more accurate result.

This would be an easy change to make and wouldn't add any additional processing time, just some simple changes to the filters. What do you think?
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: My Veeam Report v9.0.1

Veeam Logoby Backerupper » Wed Feb 17, 2016 2:34 pm

How about something like this?

Code: Select all
$vbrtasksessions = $script:allSesh |
        Where-Object {($_.JobType -eq "Backup") -and
($_.EndTime -ge (Get-Date).addhours(-$script:HourstoCheck) -or $_.State -eq "Working")} |
        Get-VBRTaskSession | Where-Object {$_.Status -notmatch "Failed|InProgress|Pending"}
Backerupper
Enthusiast
 
Posts: 42
Liked: 10 times
Joined: Fri Dec 28, 2012 2:32 pm

Re: My Veeam Report v9.0.1

Veeam Logoby Pat490 » Thu Feb 18, 2016 7:59 am 1 person likes this post

Very nice script. I just tried it for the first time. Works great!
Pat490
Expert
 
Posts: 135
Liked: 24 times
Joined: Tue Apr 28, 2015 7:18 am
Location: Germany
Full Name: Patrick

Re: My Veeam Report v9.0.1

Veeam Logoby the_mentor » Fri Feb 19, 2016 12:49 am

you probably want to change the first line error action from
Code: Select all
Add-PSSnapin "VeeamPSSnapIn" -ErrorAction SilentlyContinue

to
Code: Select all
Add-PSSnapin "VeeamPSSnapIn" -ErrorAction Stop

Since if the addon doesnt load the script cant do anything and other things inside the script will break.

just my 2 cents.
the_mentor
Enthusiast
 
Posts: 38
Liked: 5 times
Joined: Thu Jul 26, 2012 11:10 pm
Full Name: DeMentor

Re: My Veeam Report v9.0.1

Veeam Logoby SebastiaanTempels » Fri Feb 26, 2016 10:32 am

No repository details for scale-out repositories?
Can reporting on backup copy jobs also be included?
SebastiaanTempels
Lurker
 
Posts: 2
Liked: never
Joined: Mon Feb 08, 2016 1:59 pm

Re: My Veeam Report v9.0.1

Veeam Logoby another_robert » Tue Oct 18, 2016 8:06 pm

I concur if just a small area for backup copy that would be so sweet. I was shoved into the PS of veeam so to get out of this hole I just need that part. :wink:
another_robert
Novice
 
Posts: 3
Liked: never
Joined: Tue Oct 18, 2016 8:04 pm
Full Name: Robert Another

Re: My Veeam Report v9.0.1

Veeam Logoby Backerupper » Tue Oct 18, 2016 8:37 pm 1 person likes this post

A whole slew of new stuff in the works

Scale-out repositories
Replication Jobs
Backup Copy Jobs (giving me fits at the moment)
SureBackup Jobs
Task level details for all jobs (per VM)

Stay tuned!
Backerupper
Enthusiast
 
Posts: 42
Liked: 10 times
Joined: Fri Dec 28, 2012 2:32 pm


Return to PowerShell



Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests