veeam powershell

PowerShell script exchange

veeam powershell

Veeam Logoby serverbu » Wed Sep 03, 2014 1:27 pm

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?
serverbu
Enthusiast
 
Posts: 38
Liked: 4 times
Joined: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby v.Eremin » Wed Sep 03, 2014 2:47 pm

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.
v.Eremin
Veeam Software
 
Posts: 13251
Liked: 965 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: veeam powershell

Veeam Logoby serverbu » Wed Sep 03, 2014 4:06 pm

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.
serverbu
Enthusiast
 
Posts: 38
Liked: 4 times
Joined: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby v.Eremin » Thu Sep 04, 2014 8:00 am

Can you also tell me how many VMs are present inside the given job? Is it just one VM1? Thanks.
v.Eremin
Veeam Software
 
Posts: 13251
Liked: 965 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: veeam powershell

Veeam Logoby serverbu » Thu Sep 04, 2014 11:21 am

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.
serverbu
Enthusiast
 
Posts: 38
Liked: 4 times
Joined: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby v.Eremin » Fri Sep 05, 2014 9:20 am

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.
v.Eremin
Veeam Software
 
Posts: 13251
Liked: 965 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: veeam powershell

Veeam Logoby serverbu » Fri Sep 05, 2014 10:13 am

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: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby serverbu » Fri Sep 05, 2014 12:14 pm

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: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby serverbu » Fri Sep 05, 2014 1:10 pm

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.
serverbu
Enthusiast
 
Posts: 38
Liked: 4 times
Joined: Wed Feb 19, 2014 4:30 pm

Re: veeam powershell

Veeam Logoby v.Eremin » Fri Sep 05, 2014 1:59 pm

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.
v.Eremin
Veeam Software
 
Posts: 13251
Liked: 965 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: veeam powershell

Veeam Logoby Yoann.tocquet » Thu Dec 10, 2015 4:45 pm

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: Tue Aug 04, 2015 9:23 am
Full Name: yoann tocquet

Re: veeam powershell

Veeam Logoby Yoann.tocquet » Fri Dec 11, 2015 4:21 pm

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
Yoann.tocquet
Influencer
 
Posts: 22
Liked: 3 times
Joined: Tue Aug 04, 2015 9:23 am
Full Name: yoann tocquet


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests