PowerShell script exchange
Post Reply
GLeidig
Novice
Posts: 3
Liked: never
Joined: Jun 23, 2020 8:58 am
Full Name: Guenter Leidig
Contact:

Remove from configuration - cloud copy job

Post by GLeidig »

Hello,

I have an issue with cloud copy jobs: according the retention policy older weekly restore point should be removed. This is done only partly. The VBK files are removed in cloud repository but the restore points stay in the Veeam database.

Afters some months of investigation (!) Veeam Support told me that there is no solution and I have to wait for v12 (Case-Nr.05607314).

There is a manual procedure to clean up the database:

1) Disable job
2) Remove from configuration
3) Rescan cloud repository
4) edit job - map to cloud location/folder again
5) enable job

This really works but only for the moment. Next weekend an older restore point will stay in database again. It is impossible to do the manual procedure every week for each of approximately 50 cloud copy jobs!

An acceptable workaround would be a script to perform the manual procedure. This is what I have tried but does not yet work.

"Remove from configuration" does not work:

I do something like:

$VBRBackup = Get-VBRBackup -Name $Job.Name
Remove-VBRBackup $VBRBackup -Confirm:$False

... and receive the following error:

Remove-VBRBackup : Unable to remove cloud backup 5a797aec-fdd4-4d41-b3c4-47618a2d74db from configuration
At C:\scripting\VeeamCleanup\VeeamCleanup.ps1:34 char:3
+ Remove-VBRBackup $VBRBackup -Confirm:$False
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Remove-VBRBackup], Exception
+ FullyQualifiedErrorId : RemoveVBRBackup,Veeam.Backup.PowerShell.Cmdlets.RemoveVBRBackup

By the way the command works for internal copy jobs. The error only occurs when working on a cloud copy job.

Maybe some kind of login to the Cloud provider is necessary?

Any ideas?

Kind regards
Günter
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Remove from configuration - cloud copy job

Post by oleg.feoktistov » 1 person likes this post

Hi Guenter,

I will need to look into it deeper tomorrow to say for sure if there could be a scripted workaround for such scenario.
As for Remove-VBRBackup - there is simply a filtering condition that forbids cloud backups on tenant's side to be deleted.
I'm yet to figure out why. Will update this thread with all my findings if any as soon as possible.

Best regards,
Oleg
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Remove from configuration - cloud copy job

Post by oleg.feoktistov »

Hi Guenter,

So I found a delete method that could help here, however it may present buggy behavior when applied over tenant backups.
Eventually, I talked to QA, and they advised a simple method to disable backup jobs, rescan service provider and enable jobs back.
It worked in their lab, so should be applicable for your case. There would be a very simple way to automate this if it wasn't for a bug in Rescan-VBREntity -AllCloudProviders combination that should start rescan session for all providers on tenant's VBR.
So the most automated workflow to update info on tenant's side I can offer is:

1. Disable all backup jobs targeted to cloud.

Code: Select all

     $jobs = Get-VBRJob | where {$_.IsCloudTargetJob() -eq $True} # or any other criteria
     Disable-VBRJob -Job $jobs
    
2. Manually rescan cloud provider in the UI.
3. Enable jobs back.

Code: Select all

    Enable-VBRJob -Job $jobs
    
Please let me know if it helps.

Thanks,
Oleg
GLeidig
Novice
Posts: 3
Liked: never
Joined: Jun 23, 2020 8:58 am
Full Name: Guenter Leidig
Contact:

Re: Remove from configuration - cloud copy job

Post by GLeidig »

Hi Oleg,

this is exactly the new procedure suggested by VEEAM Support within my case. I have manually tested it with several cloud copy jobs - and it worked!
This procedure is far more easier to do than to manually reimport each single job. As it is only a workaround for the problem it has to be performed every week. My hope was to automate this. But as you have stated above there is a bug with rescanning the Service Provider :-(

Thank you so far
Günter
GLeidig
Novice
Posts: 3
Liked: never
Joined: Jun 23, 2020 8:58 am
Full Name: Guenter Leidig
Contact:

Re: Remove from configuration - cloud copy job

Post by GLeidig »

Hi Oleg,

Update: I have tested for one cloud copy job:
1. manually disabled the job
2. running these powershell commands:
$SP = Get-VBRCloudProvider | where DNSname -eq "xxxxx"
Rescan-VBREntity -Entity $SP -Wait
3. manually enable the job

I did not observe a buggy behavior when rescanning the Service Provider. The only thing is that nothing of the rescanning process is seen in the GUI. But it does not matter for me. The data for this job has been cleaned up.

Steps 1 and 2 can easily be done with Powershell (I will include a check whether all jobs are idle) and it seems that I can also automate step 2. This is all I wanted to have!

Best regards
Günter
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Remove from configuration - cloud copy job

Post by oleg.feoktistov »

Hi Guenter,

Ok, looks like the bug with Rescan-VBREntity is not related to the part of updating backup info. Good to know.
Anyway, glad it finally worked out for you.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests