PowerShell script exchange
Post Reply
evilaedmin
Expert
Posts: 176
Liked: 30 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Removing 'orphan' restore points

Post by evilaedmin » 1 person likes this post

Case #03812481

I have a VM with some restorepoints, a few of which does not match our retention policy:

Code: Select all

$PSDBPRD26arpm = | Get-VBRRestorePoint -Name 'psdbprd26a'
$PSDBPRD26arpm  | sort -Property CreationTime -Descending | select CreationTime -Last 5

CreationTime         
------------         
7/17/2019 12:48:34 AM
7/16/2019 12:52:40 AM
7/15/2019 1:48:10 AM 
9/28/2018 5:09:38 AM 
9/27/2018 3:30:18 AM 
I need to delete the two oldest restore points.

What's the best way to do so? Support has suggested to identify them by file name and simply delete from file system, it appears to be I can't identify the folder name, perhaps the job no longer exists or I renamed it at some point.

Is there an easy way of identifying the file path of the restore point?

Edit: followup question: Where could I find the meanings of the various methods available on Veeam Powershell objects? For example, what does the delete() method on an object returned from get-vbrrestorepoint do?

Thank you,
Eugene
evilaedmin
Expert
Posts: 176
Liked: 30 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Re: Removing 'orphan' restore points

Post by evilaedmin »

OK I think I have successfully identified that this is part of a replication job:

Code: Select all

$OldRestorePoint.FindBackup() | select Name

Name                  
----                  
psdbprd26a replica job

$OldRestorePoint.GetRepository() | select Name

Name                     
----                     
veeamgwprd01:D:\VeeamRepo

But when I browse the repository location, I cannot find any files related to this job at all.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Removing 'orphan' restore points

Post by veremin »

Just to clarify - what exact restore points you're trying to remove? Backup or replication ones? How do understand that these restore points don't respect the specified retention policy? If it's backup job, what backup method you're using (forward incremental with periodic fulls, forward forever incremental, etc.)? Are those restore points visible in backup server UI? Thanks!
Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Removing 'orphan' restore points

Post by Vek17 »

evilaedmin wrote: Oct 14, 2019 8:35 pm Edit: followup question: Where could I find the meanings of the various methods available on Veeam Powershell objects? For example, what does the delete() method on an object returned from get-vbrrestorepoint do?
The short answer here is that the behavior is undocumented and it not part of the supported API for end users. What is available and what/how they do whatever they do is subject to change without notice. I would generally only say to use methods that simply return data not ones that appear to modify it as often they do not modify them in the ways you would expect and you can end up with incomplete operations. Even with methods that simply return data it is highly preferred to use the PS commandlets if at all possible.

In this specific case I would guess (I have not tested to confirm this) that it simply removes the entry from the OIB table in the database and does nothing else. This is almost certainly not what you actually want to do and may leave you with some nonsense in the DB if you use it.
evilaedmin
Expert
Posts: 176
Liked: 30 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Re: Removing 'orphan' restore points

Post by evilaedmin »

In this specific case I would guess (I have not tested to confirm this) that it simply removes the entry from the OIB table in the database and does nothing else. This is almost certainly not what you actually want to do and may leave you with some nonsense in the DB if you use it.
Ironically enough since I can't locate these restore points on any repository I think I do want to delete any references to them :D

Thanks for clarifying the methods question very much.
Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Removing 'orphan' restore points

Post by Vek17 »

Just a warning on doing that, that method almost certainly only removes the [Backup.Model.OIBs] entry from the DB and any associated entries in [Backup.Model.Points] or [Backup.Model.Storages] will remain.

When looking to clean this up I'd be sure to engage with Veeam support explicitly to make sure everything is removed cleanly. While orphan data is usually harmless it is hard to say when unexpected behavior can show up as a result and things are much harder to diagnose when they are not in a state that is normally possible.
evilaedmin
Expert
Posts: 176
Liked: 30 times
Joined: Jul 26, 2018 8:04 pm
Full Name: Eugene V
Contact:

Re: Removing 'orphan' restore points

Post by evilaedmin »

Hello Vek17,

Support closed my case in that they cannot assist in the writing of scripts. I ended up posting about being stuck with no way to interact with the files I need to delete.
Post Reply

Who is online

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