PowerShell script exchange
Post Reply
EWMarco
Service Provider
Posts: 48
Liked: 7 times
Joined: Feb 20, 2023 9:28 am
Full Name: Marco Glavas
Contact:

Chain placement list per extent and size

Post by EWMarco »

Hi everyone

We're having problems with our SOBR extents running full. We are in the process of adding more extents but are afraid of the new space being immediately filled by all other chains being restarted on that.

Is there a script that lists the extent location inside a SOBR for all chains and their sizes?

Thank you
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Chain placement list per extent and size

Post by oleg.feoktistov »

Hi Marco,

Do you mean performance extents only or capacity/archive tiers as well?

Best regards,
Oleg
EWMarco
Service Provider
Posts: 48
Liked: 7 times
Joined: Feb 20, 2023 9:28 am
Full Name: Marco Glavas
Contact:

Re: Chain placement list per extent and size

Post by EWMarco »

I meant performance only.
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Chain placement list per extent and size

Post by oleg.feoktistov »

Here is the sample script that worked in my lab:

Code: Select all

$backup = Get-VBRBackup -Name 'Backup to SOBR'
$rps = Get-VBRRestorePoint -Backup $backup
$chainTails = @()
for ($i = 0; $i -lt $rps.Count; $i++) {
   if ($rps[$i+1].Type -eq 'Full') {
     $chainTails += $rps[$i]
   }
   elseif ($rps.IndexOf($rps[$i]) -eq [System.Array]::LastIndexOf($rps, $rps[-1])) {
    $chainTails += $rps[$i]
   }
}

foreach ($tail in $chainTails) {
  $chainRepo = $tail.FindChainRepositories()
  $chainCount = $null
  $chainSize = $null
  foreach ($count in $tail.GetChain().Count) { $chainCount += $count}
  foreach ($size in $tail.GetChain().GetStorage().Stats.BackupSize) { $chainSize += $size}
  $tail | select Name, @{n='Count';e={$chainCount}}, @{n='RepositoryExtent';e={$chainRepo.Name}}, @{n='ChainSize';e={$chainSize}}
}
Algorithm:

1. Take backup residing on SOBR and expand all its restore points.
2. Determine last chain members by validating if next restore points array member is full or the last.
3. Find all chain members for the last members determined.
4. Find repository extent for each last chain member.
5. Sum chain members count and their backup sizes.

Tested on SOBR with data locality placement policy. Might need to refactor step 4 if performance placement policy is used.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 17 guests