PowerShell script exchange
Post Reply
clintbergman
Service Provider
Posts: 18
Liked: 64 times
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
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
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: 18
Liked: 64 times
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: 2010
Liked: 670 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 » 1 person likes this post

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: 18
Liked: 64 times
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: 20415
Liked: 2302 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: 2010
Liked: 670 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: 18
Liked: 64 times
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!
AlexL
Service Provider
Posts: 105
Liked: 7 times
Joined: Aug 24, 2010 8:55 am
Full Name: Alex
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by AlexL »

I have the same need, did you ever find a solution?

For example, for an onprem local repository I've been doing something like this to query how many restorepoints have been created this day (since 00:00).

$lst = Get-VBRBackup | where {$_.jobtype -eq "backup"} | Get-VBRRestorePoint | where {$_.creationtime.date -ge (get-date).date} | Sort Name | Select-Object -Property name -Unique
$lst.count

And this is easily adapted for a BackupCopy, but how do I get the same information for how many restore points have been copied to object storage?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 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 Alex,

Currently there is no way to do this. Restore points copied to object storage are referred by the ids of restore points presented on performance tier.
So, when you obtain restore points from scale-out repository with copy mode enabled, copied points are not listed, but their presence is implied.

Thanks,
Oleg
AlexL
Service Provider
Posts: 105
Liked: 7 times
Joined: Aug 24, 2010 8:55 am
Full Name: Alex
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by AlexL »

Unfortunate, since the information is present in the database and the gui can show this information as well, would be very nice if this would be added in a future version, consider this my rfc :)
I'd settle for a sql query too to get this directly instead of thru powershell.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 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 »

Yep, we have this discussion in progress already as the feature is highly demanded. Thanks!
AlexL
Service Provider
Posts: 105
Liked: 7 times
Joined: Aug 24, 2010 8:55 am
Full Name: Alex
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by AlexL »

I found "the answer" with an sql query today, took a few hours of gazing at a lot of tables and id's but I can now get a list of all restore points that have been offloaded to object storage.
clintbergman
Service Provider
Posts: 18
Liked: 64 times
Joined: May 27, 2016 6:03 pm
Full Name: Clint Bergman
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by clintbergman »

Are you willing to share what you've found Alex? We're running custom PowerShell reporting, and adding a SQL query to the mix would be pretty trivial.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 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 » 1 person likes this post

Hi Clint,

Please check the last answers in this thread.

Thanks,
Oleg
AlexL
Service Provider
Posts: 105
Liked: 7 times
Joined: Aug 24, 2010 8:55 am
Full Name: Alex
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by AlexL »

clintbergman wrote: Nov 01, 2021 2:43 pm Are you willing to share what you've found Alex? We're running custom PowerShell reporting, and adding a SQL query to the mix would be pretty trivial.
I sent you a PM, not sure if Veeam likes lots of sql statements in the forums :) as I did as Oleg already mentioned in another topic
lbell
Lurker
Posts: 1
Liked: never
Joined: Oct 31, 2022 9:59 am
Contact:

Re: Get Restore Points from SOBR Capacity Tier?

Post by lbell »

Hello all,

Sorry to reopen this thread, but I am facing the same issue and I can't find a proper way to monitore offloading to my s3 capacity tier. I know all my backups are not uploaded, and I need to get the volume uploaded each day to ensure the issue is not on the network speed.

I find it difficult to get information on wether or not the backup is replicated on the capacity tier. The best way I found is to open properties on each job, and check the type of backup. But with the volume of VM we've got (more than 250 VM) it is really not an acceptable solution.

@AlexL can you provide the query you built (if you still have it) ? I tried by myself but ain't sure to interpret the columns the correct way.

@oleg, when will Veeam provide a more convenient way to monitor offloading status ?

Thans,
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 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,

We have this feature planned for post-v12 releases. It won't make it to v12 unfortunately.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests