PowerShell script exchange
Post Reply
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

veeam powershell

Post by serverbu »

Hello,

I am wondering why there are two cmdlets Remove-VBRBackup and Remove-VBRRestorePoint when both do exactly the same thing; deleting the entire backup chain.
Is this intended or is the Remove-VBRRestorePoint misbehaving?

We have Reverse Backup chain with 3 Restore points.

Code: Select all

Get-VBRRestorePoint -backup backupjob1 | Sort-Object creationtime -Descending
show the following:
VM Name Creation Time Type Failoved
----------- ---------------- ------ ----------
VM1 03.09.2014 15:00:41 Full
VM1 03.09.2014 14:12:19 Rollback
VM1 03.09.2014 12:56:21 Rollback
We want to delete point 03.09.2014 14:12:19 so we did the following:

Code: Select all

$restorepoint_obj=Get-VBRRestorePoint -backup testjob2 | Sort-Object creationtime -Descending | Where {$_.type -eq "Rollback"} | Select -First 1
resulting in $restorepointobject holding the following:
VM Name Creation Time Type Failoved
----------- ---------------- ------ ----------
VM1 03.09.2014 14:12:19 Rollback
Now we go:

Code: Select all

Remove-VBRRestorePoint -Oib $restorepointobject
The Result is that the complete Backup of backupjob1 is deleted. If we wanted to get such an result we simply could have used:

Code: Select all

Get-VBRBackup -Name backupjob1 | Remove-VBRBackup
.

So are we missing something on Remove-VBRRestorePoint?
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam powershell

Post by veremin »

Restore point deletion should be managed by retention settings. If you try to remove a restore point either via GUI (Remove from disk) or via PS (Remove-VBRRestorePoint/Backup) the whole chain will be deleted. Thanks.
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

Re: veeam powershell

Post by serverbu »

Than maybe renaming the cmdlet would be a nice thing as the name implicates an absolutely other behaviour (remove just restorepoint not complete chain) or remove it entirely as there allready is Remove-VBRBackup to remove the entire backup chain.
Also the description of Remove-VBRRestorePoint tells otherwise especially in Example 1:
This command removes the increment restore points from all backups with names containing "Fileserver".
This sentence says that only the increment restore points get delete but infact the fulls are also deleted because the whole chain get trashed.
So there is some inconsistency in information and naming that should be corrected.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam powershell

Post by veremin »

Can you also tell me how many VMs are present inside the given job? Is it just one VM1? Thanks.
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

Re: veeam powershell

Post by serverbu »

In this particular job its 2 VMs.
From only one of them we wanted to delete all rollback points and keep only the full backup points.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam powershell

Post by veremin »

Not sure what might be wrong in your case, but I've checked Remove-VBRRestorePoint commandlet briefly and haven't been able to confirm the described behavior. In my case, only restore points of particular VM have been removed. However, I have a forward incremental mode, not reversed incremental one. Later on, I will try to test it with reversed incremental mode, as well, and post my findings. Thanks.
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

Re: veeam powershell

Post by serverbu »

v.Eremin wrote:...checked Remove-VBRRestorePoint commandlet briefly [with] forward incremental mode, not reversed incremental one. ...
Hmm, Ok I will check with a Job of normal incremental backup on my site to see if we get behaviour as expected on this.
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

Re: veeam powershell

Post by serverbu »

Did a test with normal incremental backup

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 | Sort-Object creationtime -Descending
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test22 05.09.2014 13:11:48 Full
test20 05.09.2014 13:11:46 Full
test22 05.09.2014 13:05:48 Increment
test20 05.09.2014 13:05:46 Increment
test22 05.09.2014 13:02:18 Increment
test20 05.09.2014 13:02:16 Increment
test22 05.09.2014 12:58:14 Increment
test20 05.09.2014 12:58:12 Increment
test22 05.09.2014 12:51:42 Increment
test20 05.09.2014 12:51:39 Increment
test22 05.09.2014 12:47:23 Increment
test20 05.09.2014 12:47:21 Increment
test22 05.09.2014 12:27:59 Full
test20 05.09.2014 12:27:43 Full

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 -name test20 | Sort-Object creationtime
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test20 05.09.2014 12:27:43 Full
test20 05.09.2014 12:47:21 Increment
test20 05.09.2014 12:51:39 Increment
test20 05.09.2014 12:58:12 Increment
test20 05.09.2014 13:02:16 Increment
test20 05.09.2014 13:05:46 Increment
test20 05.09.2014 13:11:46 Ful

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 -name test20 | Sort-Object creationtime | Where {$_.type -eq "Increment"} | Select -First 1
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test20 05.09.2014 12:47:21 Increment

Code: Select all

PS> $restorepoint_obj=Get-VBRRestorePoint -backup testjob1 -name test20 | Sort-Object creationtime | Where {$_.type -eq "Increment"} | Select -First 1
PS> echo $restorepoint_obj
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test20 05.09.2014 12:47:21 Increment

Code: Select all

PS> Remove-VBRRestorePoint -Oib $restorepoint_obj
Bestätigung
Möchten Sie diese Aktion wirklich ausführen?
Ausführen des Vorgangs "Remove-VBRRestorePoint" für das Ziel "test20".
[J] Ja [A] Ja, alle [N] Nein [K] Nein, keine [H] Anhalten [?] Hilfe (Standard ist "J"): J

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 | Sort-Object creationtime -Descending
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test22 05.09.2014 13:11:48 Full
test22 05.09.2014 13:05:48 Increment
test22 05.09.2014 13:02:18 Increment
test22 05.09.2014 12:58:14 Increment
test22 05.09.2014 12:51:42 Increment
test22 05.09.2014 12:47:23 Increment
test22 05.09.2014 12:27:59 Full
So result is not only increment of Vm test20 gets deleted but fulls also.
Why is this? Fulls, regardless of wether active or synthetic, could stand on their own and don't rely on increments whatsoever. So why did the fulls get deleted, especially when only one object of an increment gets passed over?
The chain of test22 still exists, but the outcome regarding test20 is still not what one would expect.

Retention was set to hold 5 restorepoints. Maybe it trashes the fulls too because deleting the increments reduce retention to only 2 points violating the policy?
serverbu
Enthusiast
Posts: 38
Liked: 4 times
Joined: Feb 19, 2014 4:30 pm
Contact:

Re: veeam powershell

Post by serverbu »

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 -name test22 | Sort-Object creationtime
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test22 05.09.2014 13:11:48 Full
test22 05.09.2014 14:18:01 Increment
test22 05.09.2014 14:26:59 Increment
test22 05.09.2014 14:31:02 Increment
test22 05.09.2014 14:45:11 Increment

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 -name test22 | Sort-Object creationtime -descending | Where {$_.type -eq "Increment"} | Select -First 1
VM Name Creation Time Type Failoved
------- ------------- ---- --------
test22 05.09.2014 14:45:11 Increment

Code: Select all

PS> Get-VBRRestorePoint -backup testjob1 -name test22 | Sort-Object creationtime -descending | Where {$_.type -eq "Increment"} | Select -First 1 | Remove-VBRRestorePoint
Bestätigung
Möchten Sie diese Aktion wirklich ausführen?
Ausführen des Vorgangs "Remove-VBRRestorePoint" für das Ziel "test22".
[J] Ja [A] Ja, alle [N] Nein [K] Nein, keine [H] Anhalten [?] Hilfe (Standard ist "J"):J
Results in removing all restorepoints of test22.

So how the object is passed to Remove-VBRRestorePoint did not matter.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam powershell

Post by veremin »

Both GUI and PS rely on the same mechanism. So, if you try to delete individual restore point of particular VM, all restore points related to the VM will be deleted.

As to the difference between Remove-VBRRestorePoint and Remove-VBRBackup, using the former you can remove restore points of particular VM(s) out of existing chain, while with the latter one the whole backup will be deleted.

Thanks.
Yoann.tocquet
Influencer
Posts: 22
Liked: 3 times
Joined: Aug 04, 2015 9:23 am
Full Name: yoann tocquet
Contact:

Re: veeam powershell

Post by Yoann.tocquet »

Hello,

A little update on this.
On get-vbrrestorepoint you can call an method called delete, you can call it to delete a specific restore point :

PS C:\Users\Yoann> Get-VBRRestorePoint

VM Name Creation Time Type
------- ------------- ----
Finnix 10/12/2015 14:14:13 Full
Finnix 10/12/2015 14:41:19 Full
Finnix 10/12/2015 15:05:39 Increment
Finnix 10/12/2015 15:18:55 Increment
Finnix 10/12/2015 17:27:56 Full


Select only the increment :

PS C:\Users\Yoann> $RP=Get-VBRRestorePoint -Name Finnix | Where {$_.type -eq "Increment"}
PS C:\Users\Yoann> $RP

VM Name Creation Time Type
------- ------------- ----
Finnix 10/12/2015 15:05:39 Increment
Finnix 10/12/2015 15:18:55 Increment


and the increment are gone :

PS C:\Users\Yoann> $rp.delete(1)
PS C:\Users\Yoann> Get-VBRRestorePoint

VM Name Creation Time Type
------- ------------- ----
Finnix 10/12/2015 14:14:13 Full
Finnix 10/12/2015 14:41:19 Full
Finnix 10/12/2015 17:27:56 Full


At the next run of the job, there will be gone on the GUI and on the backup repository as well.
Yoann.tocquet
Influencer
Posts: 22
Liked: 3 times
Joined: Aug 04, 2015 9:23 am
Full Name: yoann tocquet
Contact:

Re: veeam powershell

Post by Yoann.tocquet »

Please note that, after a review with support, this method is not supported by Veeam as it doesn't remove SQL entries on all table.
This method can also be deleted in further version

Use it in emergency or with support help only
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests