PowerShell script exchange
Post Reply
karapoti
Influencer
Posts: 14
Liked: 1 time
Joined: Apr 12, 2018 12:22 am
Full Name: Adrian Robinson
Contact:

PS1 to find full environment size?

Post by karapoti »

Hi,

I'm at a pinch where I'm running out of space in one site now that we've migrated 99% of the clients from NBU. I'm trying to find how much source data there is that is being backed up so that we can compare with the assumptions made during the sizing phase.

I found some slick .NET work on this one, where get-vbrbackupsession was taking too long:

powershell-f26/script-too-slow-looking- ... 9195f248f9

Now trying to see how to find out the Processed/Read data values for each job - is that the right way to be going?

cheers
Adrian
david.domask
Veeam Software
Posts: 2663
Liked: 617 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: PS1 to find full environment size?

Post by david.domask » 1 person likes this post

Hi @karapoti

Few ways to go with this. I actually would suggest for environmental planning, use the Backup Files Growth Report from Veeam One: https://helpcenter.veeam.com/docs/one/r ... ml?ver=110

Should give you pretty much exactly what you're looking for without any Powershell.

If Veeam One isn't an option, I think you have two approaches:

1. Compare Backup size data to the Job Object size from Get-VBRJobObject
2. Parse the session data

I think probably it's faster/easier to compare the Backup Sizes and the JobObject sizes:

Code: Select all

PS C:\Users\Administrator> Get-VBRJObObject -Job (Get-VBRJob -name 'ps-test-job')

Name                      Type       ApproxSize       Location
----                      ----       ----------       --------
Private VMs               Include    634.8 GB         veeaminternalvc.ve...


PS C:\Users\Administrator> $jobObjects = Get-VBRJObObject -Job (Get-VBRJob -name 'ps-test-job')
PS C:\Users\Administrator> $jobObjects.ApproxSizeString
634.8 GB
Then you can compare the sum of the backup files with the GetAllChildrenStorages() method on Backup objects, and just check each individual chain. This will require some processing though (so will parsing job sessions), but I think it will be more accurate and easier maths.
David Domask | Product Management: Principal Analyst
karapoti
Influencer
Posts: 14
Liked: 1 time
Joined: Apr 12, 2018 12:22 am
Full Name: Adrian Robinson
Contact:

Re: PS1 to find full environment size?

Post by karapoti » 1 person likes this post

Thanks David - that works perfectly for VM based backups :)

Most of mine are agent based - which command would I use for them to get a job's size?

(I can wrap around the maths etc... just don't know which command to use...)
oleg.feoktistov
Veeam Software
Posts: 2021
Liked: 673 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: PS1 to find full environment size?

Post by oleg.feoktistov » 1 person likes this post

Hi Adrian,

Unlike in case with VM backup jobs, in agent backup jobs source object size is not exposed. So here you would need to go with the second approach David mentioned - parse session data. Here is an example for agent managed by VBR backup jobs:

Code: Select all

$job = Get-VBRComputerBackupJob -Name 'Linux Backup Job 2'
$sessions = Get-VBRComputerBackupJobSession | where {$_.JobId -eq $job.Id}
$taskSessions = foreach ($session in $sessions) {
  $tasks = Get-VBRTaskSession -Session $session
  $tasks | select Name, @{n='ProcessedSizeGB';e={[Math]::Round($_.Progress.ProcessedSize/1GB, 1)}}
}
Processed size should be equal to the machine's original size reflected in backup properties.

Let me know if you have any further questions.

Thanks,
Oleg
albertwt
Veteran
Posts: 954
Liked: 54 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: PS1 to find full environment size?

Post by albertwt »

Hi @Oleg,

When I execute the script there is no result returned, even after waiting for more than 20 minutes:
Image

But when I execute just the Get-VBRComputerBackupJob cmdlet, it shows the backup job.

What could be the issue here?
--
/* Veeam software enthusiast user & supporter ! */
david.domask
Veeam Software
Posts: 2663
Liked: 617 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: PS1 to find full environment size?

Post by david.domask » 1 person likes this post

Hi @albertwt,

Oleg's code saves the results to $taskSessions, so you need to call $taskSessions to see the result(s)
David Domask | Product Management: Principal Analyst
albertwt
Veteran
Posts: 954
Liked: 54 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: PS1 to find full environment size?

Post by albertwt » 1 person likes this post

@david.domask,
Yes, that's the missing part :-)

THank you, the result can now be saved into .CSVfile as well.
--
/* Veeam software enthusiast user & supporter ! */
david.domask
Veeam Software
Posts: 2663
Liked: 617 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: PS1 to find full environment size?

Post by david.domask » 1 person likes this post

Always welcome! Glad I could help :)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests