PowerShell script exchange
Post Reply
darecki
Influencer
Posts: 13
Liked: never
Joined: Jul 20, 2018 5:15 am
Full Name: Darek Margas
Contact:

After V11 upgrade .vbk files in different path

Post by darecki »

Hi Everyone,

I run scripted VeeamZIP. Till last update to v11 each run dumped vbk files in folder specified in repository setup. However, from V11 it does create folders per VeeamZIP backup and then dumps single vbk file in it.

Is there any way to reverse this change to continue with vbk files stored in single folder?

Regards,
HannesK
Product Manager
Posts: 14287
Liked: 2877 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: After V11 upgrade .vbk files in different path

Post by HannesK »

Hello,
I see what you mean... could the -Folder parameter maybe solve your issue? That one dumps it directly into the specified folder

Best regards,
Hannes
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: After V11 upgrade .vbk files in different path

Post by veremin »

Can you post the actual script, so we can verify the code? Thanks!
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: After V11 upgrade .vbk files in different path

Post by oleg.feoktistov »

Hi Darek,

This change is related rather to VeeamZIP core logic than to powershell api itself. Anyway, the main reason behind it is that in v11 we allowed offloading VeeamZIP backups to SOBR's capacity tier. In this case VBR generates metadata on a performance extent for each VeeamZIP backup. So, the problem was that if many VeeamZIP backups are offloaded, numerous meta files stored together in a performance extent's root directory would create a mess. Thus, it was decided to
put it in order a bit.

Thanks,
Oleg
darecki
Influencer
Posts: 13
Liked: never
Joined: Jul 20, 2018 5:15 am
Full Name: Darek Margas
Contact:

Re: After V11 upgrade .vbk files in different path

Post by darecki »

Thanks Oleg,

We dump it onto ZFS and run python script with some logic - find all files, extract date, couple them by object name, find if is more than two and in that case delete oldest but only if size varies by less than 20% and files are older than two weeks. This was easy in single folder, now we need to rewrite script or reverse change. BTW - did you publish this change in release notes? I didn't find it anywhere.

Cheers,
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: After V11 upgrade .vbk files in different path

Post by oleg.feoktistov »

Usually, we publish major changes there or in a what's new section. This case should have made it to the guide, though. I asked internally to add the information on that in VeeamZIP chapter. Thanks!
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: After V11 upgrade .vbk files in different path

Post by oleg.feoktistov »

We added the relevant info to VeeamZIP section. Thanks!
chriss60
Novice
Posts: 5
Liked: 1 time
Joined: Sep 06, 2022 12:18 pm
Full Name: Chris Stephens
Location: UK
Contact:

Re: After V11 upgrade .vbk files in different path

Post by chriss60 »

I have a simple script thats been working on on V10 upgraded from 9

I've now upgraded to v11 and VeeamZip does not work anymore
I tried new installation of Veeam 11 on another PC & it not working

Here is the script - appreciate any help. Thanks in advance

Code: Select all

=================
#Add-PSSnapin VeeamPSSnapin        #Need to load this for Veeam API for PowerShell NOT required on V11
$BackupDrive= "K:"                #Backup Drive Letter USB 
$BasePath   = "vBakk"             #Set BasePath 
$VMName     = "Win19SC"
#
$FullBasePath= $BackupDrive + "\" + $BasePath                 #Make Sure Base Path exists
mkdir $FullBasePath
$Path=$FullBasePath + "\" + $VMName #Set Full Path
mkdir $FullBasePath                 #Make Sure VMName path exists
$LogFile = "C:\Logs\vBakk-Win19SC" + (Get-Date -Format "yyyy-MM-dd") + ".txt"              #Set logFile
write $LogFile
write $Path
#
Write-Output "Veeam Backup of $VMName Start Time:  $('{0:yyyy-MM-dd}_{0:HH:mm:ss}' -f (Get-Date))" | Out-file $LogFile -append
#$VMName
$files = Get-ChildItem -Path $path -Recurse | Where-Object {-not $_.PsIsContainer}
$keep = 0 #set to 2 for 3 copies
if ($files.Count -gt $keep) {
    $files | Sort-Object CreationTime | Select-Object -First ($files.Count - $keep) | Remove-Item -Force 
}
Find-VBRHvEntity -Server "192.168.1.32" -Name $VMName   | Start-VBRZip -Folder $Path   #-RunAsync
#
Write-Output "Finish Time:  $('{0:yyyy-MM-dd}_{0:HH:mm:ss}' -f (Get-Date))" | Out-file $LogFile -append
#
====================
Mildur
Product Manager
Posts: 8549
Liked: 2223 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: After V11 upgrade .vbk files in different path

Post by Mildur »

Hi Chris

Can you describe the error message you got when running the script in your environment?

Thanks
Fabian
Product Management Analyst @ Veeam Software
chriss60
Novice
Posts: 5
Liked: 1 time
Joined: Sep 06, 2022 12:18 pm
Full Name: Chris Stephens
Location: UK
Contact:

Re: After V11 upgrade .vbk files in different path

Post by chriss60 »

Runing with PowerShell ISE Administrator - I get the following error

+ ... ver 192.168.1.32 -Name $VMName | Start-VBRZip -Folder $Path -RunAsync
+ CategoryInfo : NotSpecified: (:) [Start-VBRZip], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Cmdlets.StartVBRZip
Mildur
Product Manager
Posts: 8549
Liked: 2223 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: After V11 upgrade .vbk files in different path

Post by Mildur »

Hi Chris

I tested the script for my vSphere environment. I found one issue in your script:
$Path=$FullBasePath + "\" + $VMName #Set Full Path
mkdir $FullBasePath #Make Sure VMName path exists
Shouldn't that be $Path? You never create the $Path Folder. Could that be the reason why the script fails?
$Path=$FullBasePath + "\" + $VMName #Set Full Path
mkdir $Path #Make Sure VMName path exists
Thanks
Fabian
Product Management Analyst @ Veeam Software
chriss60
Novice
Posts: 5
Liked: 1 time
Joined: Sep 06, 2022 12:18 pm
Full Name: Chris Stephens
Location: UK
Contact:

Re: After V11 upgrade .vbk files in different path

Post by chriss60 »

The Disks I'm using alreday have vBakk\Win19SC - have been used for the past 2 years
Log file shows correct execution untill the upgrade to V11

I tried Find-VBRViEntity -Name Win19SC -Server 192.168.1.31 from powershell ISE prompt (Admistrator)
I think this might be the issue as it returns

Code: Select all

Find-VBRViEntity : Object reference not set to an instance of an object.
At line:1 char:1
+ Find-VBRViEntity -Name Win19SC -Server 192.168.1.31
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], NullRefere 
   nceException
    + FullyQualifiedErrorId : System.NullReferenceException,Veeam.Backup.Power 
   Shell.Cmdlets.FindVBRViEntity
Tried Host1 (instead of IP) too
Mildur
Product Manager
Posts: 8549
Liked: 2223 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: After V11 upgrade .vbk files in different path

Post by Mildur »

Find-VBRViEntity works only in vSphere environments.
Your first script has the Hyper-V Command --> Find-VBRHvEntity

Which Hypervisor have you in use?
Product Management Analyst @ Veeam Software
chriss60
Novice
Posts: 5
Liked: 1 time
Joined: Sep 06, 2022 12:18 pm
Full Name: Chris Stephens
Location: UK
Contact:

Re: After V11 upgrade .vbk files in different path

Post by chriss60 »

Hi

Only using Hyper-V - Windows 2019 Server
Mildur
Product Manager
Posts: 8549
Liked: 2223 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: After V11 upgrade .vbk files in different path

Post by Mildur »

Then try again with the command for HyperV:

Code: Select all

Find-VBRHvEntity -Name Win19SC -Server 192.168.1.31
Product Management Analyst @ Veeam Software
chriss60
Novice
Posts: 5
Liked: 1 time
Joined: Sep 06, 2022 12:18 pm
Full Name: Chris Stephens
Location: UK
Contact:

Re: After V11 upgrade .vbk files in different path

Post by chriss60 » 1 person likes this post

That produces a null - nothing returned

So tried Find-VBRHvEntity -Name Win19SC ( running on the same serve )
Tried the following 3 commands @ ISE prompt

$vm = Find-VBRHvEntity -Name Win19SC
echo $vm (to confirm)
start-VBRzip -Entity $VM -Folder r:\vBakk\Win19SC

THAT WORKS - currently Backing up

so looks like its dosen't need the -Server 192.168.1.31
Thats fine by me as I've only got the 1 Server (well 2 the old one will be decomissioned)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 21 guests