One Liner to update all jobs to optimal.

PowerShell script exchange

One Liner to update all jobs to optimal.

Veeam Logoby chrisdearden » Wed Aug 28, 2013 1:49 pm 4 people like this post

So you've just upgraded your VBR install to v7 - but now all of your jobs are using the old compression level , which is now High. If you want to take advantage of the new compression levels ( slightly less compression but vastly reduced Proxy CPU consumption ) and make that parallel processing really go at its best , you will have to reset the compression level for all of your jobs. Of course if you have compression disabled or set to other options this might not be required , but if you do have a lot of jobs to update , this little one-liner in powershell should make the job a little shorter.

Code: Select all
Get-VBRJob|Set-VBRJobAdvancedStorageOptions -CompressionLevel 5


Don't forget to run a full backup on each job to take advantage of the new settings.
chrisdearden
Expert
 
Posts: 1529
Liked: 225 times
Joined: Wed Jul 21, 2010 9:47 am
Full Name: Chris Dearden

Re: One Liner to update all jobs to optimal.

Veeam Logoby Andreas Neufert » Fri Aug 30, 2013 9:38 pm

Cool, thank you.
Andreas Neufert
Veeam Software
 
Posts: 2201
Liked: 360 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

[MERGED] : Modify settings of all replication jobs

Veeam Logoby jmcelvoy » Fri Sep 13, 2013 4:50 pm

In troubleshooting a problem I've been having, the tech had me change all my jobs to Compression=Dedupe-Friendly and Storage Optimization =WAN. I've since found that all my jobs run substantially faster with Compression=Optimal and Storage Optimization=LAN. Can I script changing this on all my jobs at the same time vs editing each job individually?
jmcelvoy
Novice
 
Posts: 7
Liked: never
Joined: Wed Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy

Re: One Liner to update all jobs to optimal.

Veeam Logoby v.Eremin » Mon Sep 16, 2013 9:27 am

Hi, Jason. The following script should answer your requirements:

Code: Select all
asnp VeeamPSSnapin
Get-VBRJob | ?{$_.jobtype -eq "Replica"} | Set-VBRJobAdvancedStorageOptions -CompressionLevel 5 -StorageBlockSize KbBlockSize512


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: One Liner to update all jobs to optimal.

Veeam Logoby jmcelvoy » Mon Sep 16, 2013 12:38 pm

Thanks for the info. This will get me going in the right direction hopefully.
Is there a way to see the settings for my jobs? I run a get-vbrjob | get-vbrjoboptions and all the output is Veeam.Backup.Model.CDomsomething. I need to see which of my jobs are set to Dedupe-Friendly with WAN target as I had a co-worker modify some of the jobs to see if that helped performance. Now I have no clue which jobs have been modified.
jmcelvoy
Novice
 
Posts: 7
Liked: never
Joined: Wed Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy

Re: One Liner to update all jobs to optimal.

Veeam Logoby jmcelvoy » Mon Sep 16, 2013 1:22 pm

In playing around with this, if I set -compressionLevel 6, it sets my job to High. If I do 7 or 8, it sets it back to Optimal. Can I somehow view my jobs compressionlevel? Also, on your example, what does -StorageBlockSize kbBlockSize512 do for my jobs?
jmcelvoy
Novice
 
Posts: 7
Liked: never
Joined: Wed Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy

Re: One Liner to update all jobs to optimal.

Veeam Logoby v.Eremin » Mon Sep 16, 2013 1:22 pm

Is there a way to see the settings for my jobs?

You can output the job options, using the following script:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Replication Job 1"
$Job.GetOptions()


The result still will be something similar to [Veeam.Backup.Model.CDomBackupStorageOptions]. The specific job options can be gotten with the usage of “.”. For instance, in order to see the backup storage options you will have to run this script:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Replication Job 1"
$Job.GetOptions().Backupstorageoptions


I need to see which of my jobs are set to Dedupe-Friendly with WAN target as I had a co-worker modify some of the jobs to see if that helped performance

Anyway, if you’re willing to list all replication jobs that have “dedupe-friendly” and “WAN target” settings you should use this one-liner:

Code: Select all
Get-VBRJob | where {($_.jobtype -eq "Replica") -and ($_.Backupstorageoptions.StgBlockSize -eq "KbBlockSize256") -and ($_.Backupstorageoptions.CompressionLevel -eq 4)} 


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: One Liner to update all jobs to optimal.

Veeam Logoby v.Eremin » Mon Sep 16, 2013 1:34 pm

Can I somehow view my jobs compression level?

The number equivalents of compression levels are as the following:

Code: Select all
0 – “none”
4 – “dedupe-friendly”
5 – “optimal”
6 – “High”
9 – "Extreme"


Also, on your example, what does -StorageBlockSize kbBlockSize512 do for my jobs?

It sets “LAN Target” as a storage optimization level. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: One Liner to update all jobs to optimal.

Veeam Logoby pknaap » Fri Oct 04, 2013 9:03 am

THX , saved some work!
pknaap
Novice
 
Posts: 3
Liked: never
Joined: Mon Feb 18, 2013 12:19 pm


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests