PowerShell script exchange
Post Reply
clintbergman
Service Provider
Posts: 12
Liked: 1 time
Joined: May 27, 2016 6:03 pm
Full Name: Clint Bergman
Contact:

Get Restore Points from SOBR Capacity Tier?

Post by clintbergman »

End goal: Know which restore points for a backup object have been copied to the SOBR Capacity Tier.

I've made some progress using helpful bits gathered from here on the forums, gathering the sobr offload jobs:

Code: Select all

$sobrOffload = [Veeam.Backup.Model.EDbJobType]::ArchiveBackup #This type corresponds to SOBR Offload job
$recentOffloadJobs = [Veeam.Backup.Core.CBackupSession]::GetByTypeAndTimeInterval($sobrOffload,(Get-Date).adddays(-30), (Get-Date).adddays(1)) | Sort-Object CreationTimeUTC -Descending
and running through those sessions looking for restore point object IDs:

Code: Select all

$sobrCopyModeRepos = Get-VBRBackupRepository -ScaleOut | Where-Object { $_.CapacityTierCopyPolicyEnabled }
$sobrRestorePoints = Get-VBRRestorePoint | Where-Object { 
	try {
		$sobrCopyModeRepos.id -contains $_.GetRepository().id
	} catch {
		# Some restore points don't have a repository set and will cause Exceptions when GetRepository is called.
		# We don't want them anyway...
		$false
	} 
}
$BackupVMs = $sobrRestorePoints | Select-Object -expand VMName -Unique
foreach ($bvm in $BackupVMs) {
	# Get Backup ObjectID
	$bvmObjID = $sobrRestorePoints | Where-Object {
		$_.VMName -eq $bvm -and `
		$_.isConsistent
	} | Select-Object -ExpandProperty ObjectID -Unique
	
	# Get SOBR Offload Tasks for Backup Object ID (VM/Agent/Whatever)
	# Because these are reverse sorted by time in '00 Veeam Initialization' (Newest First) We can just hunt for the first successful task session that transferred data
	foreach ($oJob in $recentOffloadJobs) {
		$oJobTask = $oJob.FindTaskSessionByObjectId($bvmObjID)
		if ($null -ne $oJobTask -and $oJobTask.progress.transferedSize -gt 0) {
			#Process
		}
	}	
}
And that works...sorta. I can at least get the time and results of the last recorded offload task. I would *much* prefer to be able to enumerate the restore points that exist in the capacity tier object storage similarly to how they are visible in the administrative GUI. Any thoughts?

soncscy
Expert
Posts: 258
Liked: 109 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey Carel
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by soncscy »

Hiya Clint (guessing you're a clint based on the username)

I found the property ExternalContentMode in the COib object using the FindStorage() method, and this looks to check restore points for their local vs offloaded status:

PS C:\Users\Administrator> $rps.FindStorage().ExternalContentMode
Internal
Internal

ExternalContentMode seems to define local vs up on some S3 storage with Internal (local backup) and External (offloaded)

clintbergman
Service Provider
Posts: 12
Liked: 1 time
Joined: May 27, 2016 6:03 pm
Full Name: Clint Bergman
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by clintbergman »

Soncscy,

Thanks for the reply. I had found that property as well. When I compared it to the restore points on the VBR server, I found that it represented restore points that had been *moved* to the capacity tier - but did not account for those restore points that had been *copied* and existed fully in both tiers.

oleg.feoktistov
Veeam Software
Posts: 664
Liked: 236 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by oleg.feoktistov »

Hi,

Unfortunately, will be able to get close to my computer no sooner than Friday to check for a workaround.
But we sure plan to add -FromCapacityTier and -FromArchiveTier parameters to Get-VBRRestorePoint cmdlet after v11.

Thanks,
Oleg

clintbergman
Service Provider
Posts: 12
Liked: 1 time
Joined: May 27, 2016 6:03 pm
Full Name: Clint Bergman
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by clintbergman »

Thanks for checking, Oleg. Do you mean that the parameter will be available in v11, or that the plan is to add them in an update post v11 launch?

veremin
Product Manager
Posts: 18005
Liked: 1717 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by veremin » 2 people like this post

add them in an update post v11 launch?
This.

oleg.feoktistov
Veeam Software
Posts: 664
Liked: 236 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by oleg.feoktistov »

Hi Clint,

Currently, there is no workaround to get restore points copied to Capacity Tier specifically. But if the aim is to emulate or perform restore from Capacity Tier in DR scenario, you might as well put your performance extents to maintenance mode to force capacity tier usage on restore restart.

Thanks,
Oleg

clintbergman
Service Provider
Posts: 12
Liked: 1 time
Joined: May 27, 2016 6:03 pm
Full Name: Clint Bergman
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by clintbergman »

Oleg,

Thanks for the confirmation. The aim is essentially to be able to report on the most recent restore point that has been copied to capacity tier. We have daily reports that we run to check on a variety of specifics, and since moving from cloud connect backup copy jobs to the capacity tier of SOBRs it's been a bit more difficult to report on what restore points exist offsite. What we have is sufficient for now, though I'll be eagerly awaiting the -FromCapacityTier and -FromArchiveTier parameters.

Thanks again!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests