PowerShell script exchange
Post Reply
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

getting File Backups size for a SOBR

Post by kpolsana »

Hello,
What is the best method to get the file backups size for the SOBR using powershell commands and also is it possible to get all the details as in the picture attached, not sure how to attach the picture please advise
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: getting File Backups size for a SOBR

Post by oleg.feoktistov »

Hi,

You will need to host image somewhere online and insert the image link into your message in full editor & preview mode using image icon above the message field. A tooltip with the formatting required will appear once you hover over the image icon.

Best regards,
Oleg
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

Here is the link to the picture of details we are looking for ?

https://ibb.co/8cCJKHq
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: getting File Backups size for a SOBR

Post by oleg.feoktistov »

The link leads me right to "Page doesn't exist" exception. Looks like the hosting has expired.
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

Were you able to see the picture
david.domask
Veeam Software
Posts: 2331
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: getting File Backups size for a SOBR

Post by david.domask »

Can I ask, why powershell if you already have a reporting tool? VeeamOne can do similar reports also; this is a fairly involved script, and since there looks to be a report already and VeeamOne has one, why not just use those?

https://helpcenter.veeam.com/docs/one/r ... ml?ver=120
David Domask | Product Management: Principal Analyst
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

we use this data to bill the clients and it is getting harder to look at the reports to create the bill or the invoice, we would like to leverage our automation platform which can get this info and create those invoices. Thus it is important for us to get this data. Please advise what is the best way to get this information
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

checking in for a response ?
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: getting File Backups size for a SOBR

Post by oleg.feoktistov »

I was able to query everything except for file and application backup sizes and out of space metrics.
That's how I would get all the rest:

Code: Select all

$sobr = Get-VBRBackupRepository -Name 'Scale-out Backup Repository 2' -ScaleOut
$placementPolicy = $sobr.PolicyType
$extents = $null
foreach ($extent in $sobr.Extent) {
  $extents += 1
}
$capacityExtents = $null

foreach ($capacityExtent in $sobr.CapacityExtents) {
 $capacityExtents += 1
}

$archiveExtent = $false
$extentsString = "$($extents) performance, $($capacityExtents) capacity"
if ($sobr.ArchiveExtent) {
 $archiveExtent = $true
 $extentsString = "$($extents) performance, $($capacityExtents) capacity, archive present"
}
$backups = Get-VBRBackup | where {$_.RepositoryId -eq $sobr.Id}
$childBackups = $backups.FindChildBackups()
$objects = $childBackups.GetObjects() | select -Unique
$vbks = $backups.GetAllChildrenStorages() | where {$_.HasVbk -eq $true}
$fullSize = $null
foreach ($vbk in $vbks) {
  $fullSize += $vbk.Stats.BackupSize
}
$vibs =  $backups.GetAllChildrenStorages() | where {$_.HasVbk -eq $false}
$incrementSize = $null
foreach ($vib in $vibs) {
  $incrementSize += $vib.Stats.BackupSize
}
$totalSpace = [Veeam.Backup.Core.CBackupRepository]::Get($sobr.Id).GetContainer().CachedTotalSpace.ToString()
$freeSpace = [Veeam.Backup.Core.CBackupRepository]::Get($sobr.Id).GetContainer().CachedFreeSpace.ToString()
$sobr | select Name, @{n='PlacementPolicy';e={$placementPolicy}}, @{n='Extents';e={$extentsString}}, `
@{n='FullsSizeKB';e={$fullSize / 1KB}}, @{n='IncrementsSizeKB';e={$incrementSize / 1KB}}, `
@{n='TotalSpace';e={$totalSpace}}, @{n='FreeSpace';e={$freeSpace}}
Please note that it involves invoking unsupported methods and classes.

Best regards,
Oleg
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

The important thing we are looking for is the file and application backup sizes and out of space metrics, how can I get these metrics, if Veeam one is able to get it, then it is matter of how can we get it ? could you please help out ?
david.domask
Veeam Software
Posts: 2331
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: getting File Backups size for a SOBR

Post by david.domask »

When you say "out of space metrics", what are you looking to report on @kpolsana? Just when a repository is reaching a certain threshold?

The $totalspace and $freesapce variables in Oleg's script can just be used in basic math to determine if the repo is approaching capacity. Something like:

If($freespace/$totalspace -le "Some value){
<write code to send warning or do the desired action
}
David Domask | Product Management: Principal Analyst
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

looking for predicting how many does the storage support and what about the file backup size ?
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: getting File Backups size for a SOBR

Post by kpolsana »

I tested the above script and these are the things I'm still looking for following info
1. Stored VM's and Computers
2. File Backups
3. Application backups
david.domask
Veeam Software
Posts: 2331
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: getting File Backups size for a SOBR

Post by david.domask »

@kpolsana, for how many backups it will support, that's very difficult to say. VeeamOne has growth prediction algorithms written outside of just fetching the data; there isn't a specific property on repositories like "can support N backups", so you will need to use the information from Oleg's code and work with your team to build a growth rate algorithm; this is fairly complex, and it's why I really recommend focusing on the pre-made reports as this is a bit of coding. I know you want to ingest it, but honestly this is quite a project to write on your own and there is a lot of it that will need to be just your own code to use the data and mimic the VeeamOne reports/your earlier report.

For getting Stored VMs and Computers, Oleg's code will work.

For application backups and NAS Backups (file backups), you will need to pass their session data retrieved with their specific cmdlets:

NAS Backups: https://helpcenter.veeam.com/docs/backu ... ml?ver=120
Application Backups: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

They don't have cmdlets to report on their sizes, so you'll need to pull the data from the Sessions cmdlets.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests