Feature request: exclusions filters

PowerShell script exchange

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Thu Oct 10, 2013 11:19 am

Hi, Aaron.

I’ve already created a script that does something similar to what you’ve requested with the only exception that the script covers the case with ESX(i) host instead of cluster. So, if you modify it a little bit, it will meet your requirements.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Feature request: exclusions filters

Veeam Logoby decoy5657 » Thu Oct 10, 2013 1:30 pm

Code: Select all
Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin VeeamPSSnapin
Connect-VIServer server.local.lan

Clear-Host

$DevClusterVMsToAdd = Get-Cluster "Development" | Get-VM | Where-Object {$_.Name -notlike "*b"}
Add-VBRJobObject -Job "Development" -Server server.local.lan -Objects $DevClusterVMsToAdd

$ProductionClusterVMsToAdd = Get-Cluster "Production" | Get-VM | Where-Object {$_.Name -notlike "*b"}
Add-VBRJobObject -Job "Production" -Server server.local.lan -Objects $ProductionClusterVMsToAdd


To solve my problem I used the above script. I just have to ensure that it runs on a regular basis to get new machines into the job. The only problem I see is that it says "Add-VBRJobObject" is outdated and to use "Add-VBRViJobObject" instead. "Add-VBRViJobObject" doesn't use "-Objects" it requires "-Entities" and I can't pipe in machine names from the get-cluster and get-vm commands.
decoy5657
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson

Re: Feature request: exclusions filters

Veeam Logoby decoy5657 » Thu Oct 10, 2013 1:32 pm

v.Eremin wrote:Hi, Aaron.

I’ve already created a script that does something similar to what you’ve requested with the only exception that the script covers the case with ESX(i) host instead of cluster. So, if you modify it a little bit, it will meet your requirements.

Thanks.



This? viewtopic.php?f=26&t=17021#p81321
decoy5657
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Thu Oct 10, 2013 1:43 pm

Yep, you have to:

• Firstly, connect to vCenter server and find VMs that reside on a given cluster and that have names starting with “b”.
• Secondly, create a temp job (“Temporary job”).
• Thirdly, add to the temp job VMs collected at step 1.
• Fourthly, for each VM create object of the ”CObjectInJob” type.
• Fifthly, exclude the said objects from a given job.
• Finally, delete temporary job.

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

[MERGED] Looking for an easy way to add an exclusion to all

Veeam Logoby electricd7 » Mon Feb 24, 2014 2:57 pm

Hello,

I have a client with a large number of backups. All jobs are setup to backup entire datastores. Sometimes they will storageVmotion disks within individual machines to different datastores. There are certain machines which are excluded from backups but when they move the disks to other datstores those machines get picked up by the other datastore job because there are no exclusions. I am looking for a way to write a script which will take VM names or Folders as inputs and will add (or verify if already added) those to the exclusions for either a given job or for all jobs. Can this be done easily?
electricd7
Expert
 
Posts: 103
Liked: 5 times
Joined: Tue Mar 27, 2012 10:13 pm
Full Name: Chad Killion

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Mon Feb 24, 2014 3:40 pm

Hi, I have already created the script that excludes certain VMs out of the backup job, in case where container (folder, datastore) is selected as the job object. The only thing that has to be modified here is $ObjectsToExclude variable.

Please, take a look and ask if any additional help is needed.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests