PowerShell script exchange
Post Reply
Bharathy
Novice
Posts: 7
Liked: never
Joined: Nov 17, 2021 1:03 pm
Full Name: Bharathy
Contact:

Veeam powershell IncludedSize returns zero

Post by Bharathy »

I am writing a script to calculate the size of VMs in a Veeam backup job.

Option #1: Using Info.IncludedSize

Code: Select all

$Job = get-vbrjob -Name "Backup_SQLservers"
$Jobsize = [math]::round($Job.Info.IncludedSize /1GB, 2)
Option #2: Using ApprozSizeString

Code: Select all

$Job = get-vbrjob -Name "Backup_SQLservers"
$Job.GetObjectsInJob() | Foreach-object {$jobsize = $jobsize + ($_.ApproxSizeString)}
Option #1 returns '0' for few jobs and returns exact VMs size for few jobs. I tried to press 'recalculate' using GUI wizard of the job properties. Still I get 0 as size for few jobs.

Option #2 returns value but it is not exact size of the VMs in the job. It is less than what I see in the GUI wizard of the job properties.

Could someone advise what is the best way to calculate the size of VMs in the backup job?
soncscy
Veteran
Posts: 643
Liked: 314 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: Veeam powershell IncludedSize returns zero

Post by soncscy »

Hey Bharathy,

For the jobs that return 0, are you using containers like folders/resource pools/datastores or tags? If so, those won't get processed by powershell as far as I know and don't get looked up.

I know that the ApproxSize data is stored in OIB Auxdata I think if you get down to the OIB level in Backups. Might be your best approach if you are using containers.
oleg.feoktistov
Veeam Software
Posts: 2024
Liked: 674 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Veeam powershell IncludedSize returns zero

Post by oleg.feoktistov »

Hi guys,

Checked it in v11 GA and 11a - we actually reflect sizes for included containers through Powershell.
Another question is, @Bharathy do you also try to query IncludedSize for agent backup and backup copy jobs?
Because in these cases zeroes would make sense.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests