PowerShell script exchange
Post Reply
chris.childerhose
Veeam Vanguard
Posts: 572
Liked: 132 times
Joined: Aug 13, 2014 6:03 pm
Full Name: Chris Childerhose
Location: Toronto, ON
Contact:

Storage Integration Settings

Post by chris.childerhose »

Does anyone have the commands for setting the Storage Integration tab settings within a job? We just updated to ENT+ licensing and I want to set all jobs to integrate with Nimble rather than one at a time. :)
-----------------------
Chris Childerhose
Veeam Vanguard / Veeam Legend / Veeam Ceritified Architect / VMCE
vExpert / VCAP-DCA / VCP8 / MCITP
Personal blog: https://just-virtualization.tech
Twitter: @cchilderhose
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Storage Integration Settings

Post by nielsengelen »

By default is is enabled for each new job (even if u don't have Ent+).

U can check for the job settings via:

Code: Select all

$job = Get-VBRJob -Name "JOB NAME"
$option = $job.GetOptions()
$option.SanIntegrationOptions
You can enable it via:

Code: Select all

$job = Get-VBRJob -Name "JOB NAME"
Disable-VBRJob -Job $job
$options = $job.GetOptions()
$options.SanIntegrationOptions.UseSanSnapshots = "True"
$job.SetOptions($options)
Enable-VBRJob -Job $job
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin »

In order to apply the suggested changes to all jobs at once, use something like this:

Code: Select all

Asnp VeeamPSSnapin
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
{
Disable-VBRJob -Job $job
$options = $job.GetOptions()
$options.SanIntegrationOptions.UseSanSnapshots = "True"
$job.SetOptions($options)
Enable-VBRJob -Job $job
}

chris.childerhose
Veeam Vanguard
Posts: 572
Liked: 132 times
Joined: Aug 13, 2014 6:03 pm
Full Name: Chris Childerhose
Location: Toronto, ON
Contact:

Re: Storage Integration Settings

Post by chris.childerhose »

Thanks for this guys. So this enables the first check box but what if you want all of them enabled? What are the names for the other 3 options in that dialog?
-----------------------
Chris Childerhose
Veeam Vanguard / Veeam Legend / Veeam Ceritified Architect / VMCE
vExpert / VCAP-DCA / VCP8 / MCITP
Personal blog: https://just-virtualization.tech
Twitter: @cchilderhose
chris.childerhose
Veeam Vanguard
Posts: 572
Liked: 132 times
Joined: Aug 13, 2014 6:03 pm
Full Name: Chris Childerhose
Location: Toronto, ON
Contact:

Re: Storage Integration Settings

Post by chris.childerhose »

I found the names so just need the string for all of them together to set TRUE.

Names -

UseSanSnapshots
MultipleStorageSnapshotEnabled
FailoverFromSan
Failover2StorageSnapshotBackup
-----------------------
Chris Childerhose
Veeam Vanguard / Veeam Legend / Veeam Ceritified Architect / VMCE
vExpert / VCAP-DCA / VCP8 / MCITP
Personal blog: https://just-virtualization.tech
Twitter: @cchilderhose
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Storage Integration Settings

Post by nielsengelen » 1 person likes this post

That would be:

Code: Select all

$options.SanIntegrationOptions.UseSanSnapshots = "True"
$options.SanIntegrationOptions.MultipleStorageSnapshotEnabled= "True"
$options.SanIntegrationOptions.FailoverFromSan= "True"
$options.SanIntegrationOptions.Failover2StorageSnapshotBackup= "True"
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
chris.childerhose
Veeam Vanguard
Posts: 572
Liked: 132 times
Joined: Aug 13, 2014 6:03 pm
Full Name: Chris Childerhose
Location: Toronto, ON
Contact:

Re: Storage Integration Settings

Post by chris.childerhose »

Thanks I figured it out probably while you were replying. Code is as follows for those that need it -

Code: Select all

foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
{
Disable-VBRJob -Job $job
$options = $job.GetOptions()
$options.SanIntegrationOptions.UseSanSnapshots = "True"
$options.SanIntegrationOptions.MultipleStorageSnapshotEnabled = "True"
$options.SanIntegrationOptions.FailoverFromSan = "True"
$options.SanIntegrationOptions.Failover2StorageSnapshotBackup = "True"
$job.SetOptions($options)
Enable-VBRJob -Job $job
}
-----------------------
Chris Childerhose
Veeam Vanguard / Veeam Legend / Veeam Ceritified Architect / VMCE
vExpert / VCAP-DCA / VCP8 / MCITP
Personal blog: https://just-virtualization.tech
Twitter: @cchilderhose
RubinCompServ
Service Provider
Posts: 259
Liked: 65 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Re: Storage Integration Settings

Post by RubinCompServ »

I just want to update this thread to say that, instead of using "True", you should be using $TRUE. In this case it makes no difference, but - due to an interpretation oddity in PowerShell - you could actually put ANYTHING in those quotation marks (including FALSE), and it will still treat them as true. If you wanted to use the script to turn OFF the options (as I did), you would need $FALSE, rather than "False"
dries.vergote
Service Provider
Posts: 40
Liked: 5 times
Joined: Apr 24, 2015 2:51 pm
Full Name: Dries Vergote
Contact:

Re: Storage Integration Settings

Post by dries.vergote »

Hi

I'm busy with a bulk insert for 50 datastore that are using Storagesnapshot as primary target.
I'm using snapvault as secundary target. but don't find the powershell command to enable secundary target.

The code below 2 line doesn't work as the enable secondary target isn't enabled.

Code: Select all

$Job = get-vbrjob -name $JobName
$joboptions = Get-VBRJobOptions $job
$JobOptions.SanIntegrationOptions.SanSnapshotSourceEnabled = $true
$JobOptions.SanIntegrationOptions.SanSnapshotSourceRetention = 7
   $joboptions.SanSnapshotBackupTransferEnabled= $True #doesn't work
   $joboptions.SanSnapshotBackupTransferRetention = 35 #doesn't work
$Job | Set-VBRJobOptions -Options $JobOptions
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin » 1 person likes this post

The following script did the trick for me:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup job"
$Options.sanintegrationoptions.sansnapshotbackuptransferenabled = $True
$Options.sanintegrationoptions.sansnapshotbackuptransferretention = 35
Set-VBRJobOptions -Job $Job -Options $Options
In your example you seem to have missed sanintergrationoptions in the last few lines.

Thanks!
dries.vergote
Service Provider
Posts: 40
Liked: 5 times
Joined: Apr 24, 2015 2:51 pm
Full Name: Dries Vergote
Contact:

Re: Storage Integration Settings

Post by dries.vergote »

Hi

Thanks for correction, In my test is used the sanintegrationoptions but in my actual script I forgot to add it indeed.
Works now.

Regards
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin »

You're welcome. Glad to hear that you're up and running now.

Should other help be needed, let us know.

Thanks!
dries.vergote
Service Provider
Posts: 40
Liked: 5 times
Joined: Apr 24, 2015 2:51 pm
Full Name: Dries Vergote
Contact:

Re: Storage Integration Settings

Post by dries.vergote »

Hi
Since update 4 is see the following occurence. I'm adjusting the same way as above my retention point for the storage snapshot.
The setting is adjust immediately if you check the parameters with powershell. But if you go to the GUI the default of 14 days is still there. If you change in the GUI you see the change in powershell as well.

Code: Select all

$Job = get-vbrjob -name $JobName
$joboptions = Get-VBRJobOptions $job
$JobOptions.SanIntegrationOptions.SanSnapshotSourceEnabled = $true
$JobOptions.SanIntegrationOptions.SanSnapshotSourceRetention = "2"
Set-VBRJobOptions -job $Job -Options $JobOptions
I tried both $job | set-vbrjoboptions and the one above.

Is this a bug or what is changed in update4 that needs to adjusted ?
Tested the same thing on Update3a and works as a charm.

regards
dries.vergote
Service Provider
Posts: 40
Liked: 5 times
Joined: Apr 24, 2015 2:51 pm
Full Name: Dries Vergote
Contact:

powershell to change values of retention on storage snapshot

Post by dries.vergote » 1 person likes this post

Hi

I got the following answer from Veeam support:
After Update 4 we partly changed the logic for many of the PS options and commands. And concerning the retention policy, our developers decided to lead this option to a general view for all the commands. So now, to change retention policy for your NetApp backup job, you need to use the following script:

Code: Select all

$Job = get-vbrjob -name 'JobName'
$joboptions = Get-VBRJobOptions $job
$JobOptions.BackupStorageOptions.RetainCycles = "2"
Set-VBRJobOptions -job $Job -Options $JobOptions 
This is working but is confusing if you check the joboptions options and you can not change it via
$JobOptions.SanIntegrationOptions.SanSnapshotSourceRetention = "2"

Greetz
Dries
lightsout
Expert
Posts: 227
Liked: 62 times
Joined: Apr 10, 2014 4:13 pm
Contact:

[MERGED] Secondary Target NetApp SnapVault

Post by lightsout »

Dear all,

Is there some code out there to add a NetApp snapshot as the secondary destination job? Want it configured for Snapvault, not snapshots and to be used as the primary source for backup jobs.

Thanks!
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin »

Can you tell me whether the script provided above works for you? Thanks!
lightsout
Expert
Posts: 227
Liked: 62 times
Joined: Apr 10, 2014 4:13 pm
Contact:

Re: Storage Integration Settings

Post by lightsout »

No, I'm asking a different question. The above is turning on storage snapshots on the SAN.

What I want to do is to turn on the 'snapvault' NetApp option as a secondary job target via PowerShell. It is similar in concept, but handled far differently in Veeam itself.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin »

Can you provide a screenshot of options you'd like to enable? In my case I've managed to enable secondary destination job via this script

Image
lightsout
Expert
Posts: 227
Liked: 62 times
Joined: Apr 10, 2014 4:13 pm
Contact:

Re: Storage Integration Settings

Post by lightsout »

Thanks, that has done it!
sandsturm
Veteran
Posts: 278
Liked: 23 times
Joined: Mar 23, 2015 8:30 am
Contact:

[MERGED] Create Backupjob with Secondary backup destination

Post by sandsturm »

Hi

I couldn't find the necessary command to set the "Configure secondary backup destination for this job" with a powershell command. I searched with googling around and checked also the
powershell backup job options but could not find it.
My idea is to add a Netapp Snapvault destination as a secondary backup destination to a backupjob. Can someone help me?

thx
sandsturm
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Storage Integration Settings

Post by veremin »

Kindly, check the examples provide above; should be something you're looking for. Thanks!
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 23 guests