-
- Novice
- Posts: 4
- Liked: never
- Joined: Oct 16, 2023 5:17 pm
- Full Name: Glen Adkins
- Contact:
Total Storage used per Job for offsite calculation
Hello,
I need to calculate how much offsite storage I may need for my offsite backups of my current backup chains. I put together something but its not quite what I am looing for. Obviously management needs this to determine how much storage we need to purchase for our offsite copy jobs. It would be great if it outputs to a excel spreadsheet as well. I have a script as I said, but I am not sure of the values it is returning and if this is the number I need. Also, I cannot tell the size format either. This is an output example:
Jobname Endtime TotalUsedSize ReadSize TransferedSize
prod-job-01 10/15/2023 22:07 58,312,616,455,234 3,504,784,539,648 1,283,170,031,516
Is this the total size of the job, including all of the restore points, or simply last nights job size?
Ideas?
Thank you
Glen
I need to calculate how much offsite storage I may need for my offsite backups of my current backup chains. I put together something but its not quite what I am looing for. Obviously management needs this to determine how much storage we need to purchase for our offsite copy jobs. It would be great if it outputs to a excel spreadsheet as well. I have a script as I said, but I am not sure of the values it is returning and if this is the number I need. Also, I cannot tell the size format either. This is an output example:
Jobname Endtime TotalUsedSize ReadSize TransferedSize
prod-job-01 10/15/2023 22:07 58,312,616,455,234 3,504,784,539,648 1,283,170,031,516
Is this the total size of the job, including all of the restore points, or simply last nights job size?
Ideas?
Thank you
Glen
-
- Veeam Software
- Posts: 2013
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Total Storage used per Job for offsite calculation
Hi Glen,
It's really hard to tell whether you are getting correct metrics without looking into the script. Could you please share it? Omitting private info, of course.
Best regards,
Oleg
It's really hard to tell whether you are getting correct metrics without looking into the script. Could you please share it? Omitting private info, of course.
Best regards,
Oleg
-
- Novice
- Posts: 4
- Liked: never
- Joined: Oct 16, 2023 5:17 pm
- Full Name: Glen Adkins
- Contact:
Re: Total Storage used per Job for offsite calculation
Thank you.
As requested.
As requested.
Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer | out-null
connect-vbrserver -server servername -user useraccount
$JobsOutput = @()
Foreach ($JobObject in Get-VBRJob | ?{$_.JobType -eq "Backup"})
{
$LastSession = $JobObject.FindLastSession()
$JobOutput = New-Object -TypeName PSObject
$JobOutput | Add-Member -Name "Jobname" -MemberType Noteproperty -Value $JobObject.Name
$JobOutput | Add-Member -Name "Endtime" -MemberType Noteproperty -Value $LastSession.endtime
$JobOutput | Add-Member -Name "TotalUsedSize" -MemberType Noteproperty -Value $LastSession.Info.Progress.TotalUsedSize
$JobOutput | Add-Member -Name "ReadSize" -MemberType Noteproperty -Value $LastSession.Info.Progress.ReadSize
$JobOutput | Add-Member -Name "TransferedSize" -MemberType Noteproperty -Value $LastSession.Info.Progress.TransferedSize
$JobsOutput += $JobOutput
$JobsOutput | Export-Csv -Path c:\temp\Storagetest.csv
}
$JobsOutput | Out-GridView
Disconnect-VBRServer | out-null
-
- Veeam Software
- Posts: 2013
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Total Storage used per Job for offsite calculation
Thanks for sharing the script. Just for future references - in the message preview mode you can wrap your code in tags (</> label) to make it more readable (like I did above).
As for your questions:
ReadSize - the amount of data read from source before applying compression and deduplication.
TransferedSize - the amount of data transferred to target after applying compression and deduplication.
You can read more on the real-time session metrics here.
The closest data here that more or less corresponds to the size of a restore point is the one held in TransferedSize. However, VBR can invoke other activities that may impact the resulting restore point size. So if you are after actual amount of all the restore points created in a backup, here is the better way to get this info:
This script sums up all actual backup file sizes in a backup and reflects total size along with the backup name for each job.
Hope it helps,
Oleg
As for your questions:
TotalUsedSize - the used size on a source VM.I am not sure of the values it is returning and if this is the number I need
ReadSize - the amount of data read from source before applying compression and deduplication.
TransferedSize - the amount of data transferred to target after applying compression and deduplication.
You can read more on the real-time session metrics here.
These sizes are all in bytes, so for convenience I usually go with this formatting:Also, I cannot tell the size format either
Code: Select all
[Math]::Round($LastSession.Info.Progress.TransferedSize/1GB, 2)
Your script pulls only the last run for each job. Meaning it will calculate metrics only for the last restore point for each job you iterate over.Is this the total size of the job, including all of the restore points, or simply last nights job size?
The closest data here that more or less corresponds to the size of a restore point is the one held in TransferedSize. However, VBR can invoke other activities that may impact the resulting restore point size. So if you are after actual amount of all the restore points created in a backup, here is the better way to get this info:
Code: Select all
$ErrorActionPreference = "SilentlyContinue"
$backups = Get-VBRBackup
$jobs = Get-VBRJob | where {$_.JobType -eq 'Backup'}
foreach ($job in $jobs) {
$backup = $backups | where {$_.JobId -eq $job.Id}
$storages = $backup.GetAllChildrenStorages()
$totalSize = $null
foreach ($storage in $storages) {
$totalSize += $storage.Stats.BackupSize
}
$backup | select Name, @{n='TotalSize';e={[Math]::Round($totalSize/1GB, 2)}}
}
Hope it helps,
Oleg
-
- Novice
- Posts: 4
- Liked: never
- Joined: Oct 16, 2023 5:17 pm
- Full Name: Glen Adkins
- Contact:
Re: Total Storage used per Job for offsite calculation
I copied and pasted what you wrote into a new script and then added the VBR server and it runs, but it doesnt display anything. I am assuming I need to add that portion. Correct?
I added this.
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer | out-null
connect-vbrserver -server =VBRServer -user useraccount
Not sure which variable I need to use to output this to a CSV file.
Ideas?
Thanks
Glen
I added this.
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue
Disconnect-VBRServer | out-null
connect-vbrserver -server =VBRServer -user useraccount
Not sure which variable I need to use to output this to a CSV file.
Ideas?
Thanks
Glen
-
- Veeam Software
- Posts: 2013
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Total Storage used per Job for offsite calculation
Looks like mistyped the property name. It should be $jobs = Get-VBRJob | where {$_.JobType -eq 'Backup'}. I amended the original script.
You could declare an empty array for all backups before the loop and add there a backup every iteration. Then export this array to csv like you did in your script. Thanks!Not sure which variable I need to use to output this to a CSV file.
-
- Novice
- Posts: 4
- Liked: never
- Joined: Oct 16, 2023 5:17 pm
- Full Name: Glen Adkins
- Contact:
Re: Total Storage used per Job for offsite calculation
Thank you! Got it! This worked for what I needed.
Thanks again!!
Glen
Thanks again!!
Glen
-
- Service Provider
- Posts: 339
- Liked: 82 times
- Joined: Mar 16, 2015 4:00 pm
- Full Name: David Rubin
- Contact:
Re: Total Storage used per Job for offsite calculation
This was a HUGE help! Thank you @oleg.feoktistov!oleg.feoktistov wrote: ↑Oct 17, 2023 4:46 pmThis script sums up all actual backup file sizes in a backup and reflects total size along with the backup name for each job.Code: Select all
$ErrorActionPreference = "SilentlyContinue" $backups = Get-VBRBackup $jobs = Get-VBRJob | where {$_.JobType -eq 'Backup'} foreach ($job in $jobs) { $backup = $backups | where {$_.JobId -eq $job.Id} $storages = $backup.GetAllChildrenStorages() $totalSize = $null foreach ($storage in $storages) { $totalSize += $storage.Stats.BackupSize } $backup | select Name, @{n='TotalSize';e={[Math]::Round($totalSize/1GB, 2)}} }
Hope it helps,
-
- Veeam Software
- Posts: 2013
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Total Storage used per Job for offsite calculation
@RubinCompServ, glad to help. Have a great New Year!
Who is online
Users browsing this forum: No registered users and 13 guests