PowerShell script exchange
Post Reply
Da PAN
Lurker
Posts: 1
Liked: never
Joined: Nov 10, 2010 2:44 pm
Contact:

How do I set DiskFilter and other exclude parameters

Post by Da PAN » May 24, 2013 10:41 am

Hello,

we are backing up just the system disk of nearly all (VMware) VMs. So we have to add the VMs to a backup job, edit the exclusions, edit every VM to exclude all disks apart from the system disk, change the checkbox "remove disk from backuped VM". This is a part of work we would like to automate. Creating job and adding VMs with Powershell is no problem but how do I change the settings mentioned above for each VM?

Regards
Henry

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » May 24, 2013 11:42 am

Unfortunately, for now it seems to be a general limitation that DiskFilter options can’t be specified, at least, I don’t know a way how it can be done.

Thanks.

mdivis
Lurker
Posts: 1
Liked: never
Joined: Sep 24, 2013 6:49 am
Full Name: Martin Divis
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by mdivis » Sep 25, 2013 1:02 pm

this works, though I do no know how far supported it is:

Code: Select all

$job = Get-VBRJob -name test
$objects = $job.GetObjectsInJob()
$object = $objects | where {$_.name -eq 'other64'}
$objInfo = $object.info
$objInfo.diskFilter = '2000;2005'
[Veeam.Backup.Core.CObjectInJob]::Update($objInfo)
will restrict vm's 'other64' backup to disks SCSI0:0 and SCSI0:5

decoy5657
Influencer
Posts: 12
Liked: 3 times
Joined: Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by decoy5657 » Dec 02, 2013 4:36 am

Here's a little code block I use. I update my jobs daily w/ a powershell script. SQL boxes only get the system disk w/ Veeam. So I Just added a loop to what mdivis posted.

Code: Select all

$SQLjob = Get-VBRJob -name SQL
$SQLobjects = $SQLjob.GetObjectsInJob()

ForEach ($SQLobject in $SQLobjects)
{
$SQLobjInfo = $SQLobject.info
$SQLobjInfo.diskFilter = '2000'
[Veeam.Backup.Core.CObjectInJob]::Update($SQLobjInfo)
}

slide999
Novice
Posts: 4
Liked: never
Joined: Sep 25, 2014 9:40 pm
Full Name: Kevin
Contact:

[MERGED] : Can I modify exclusions via PowerShell

Post by slide999 » Sep 25, 2014 9:49 pm

Support Case 00642976

Hi - I was wondering if/how I can modify via PowerShell the 'virtual machine exclusions'? I just want disks 0:0 and 0:1 backed. Thanks in advance.

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Sep 26, 2014 11:05 am

Hi Kevin,

It should be possible with the use of creative workarounds provided above.

Thanks.

MrJH
Influencer
Posts: 14
Liked: 2 times
Joined: Aug 18, 2015 2:01 pm
Contact:

[MERGED] Backup particular drive of a VM?

Post by MrJH » Aug 10, 2017 8:13 am

Is this possible? We have a VM with 3 data drives, but I only wish to specify a particular one for backup. Is there a Veeam PS switch for this?
Thanks.

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Aug 10, 2017 10:32 am

Check the solution coined above. Thanks.

dperabo
Influencer
Posts: 10
Liked: never
Joined: Aug 14, 2015 12:21 pm
Full Name: Daniel
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by dperabo » Jan 18, 2019 8:12 am

Hi,
is there a way to disable the diskfilter with powershell?
i need "All disks" :mrgreen:

Thanks

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Jan 18, 2019 11:56 am

Check the following script:

Code: Select all

asnp VeeamPSSnapin
$job = Get-VBRJob -name "Name of your Job"
$objects = $job.GetObjectsInJob()
ForEach ($object in $objects)
{
$ObjectInfo = $Object.info
$objectinfo.diskfilter = 'Ver8|3000;3001;3002;3003;2000;2001;2002;2003;2004;2005;2006;2008;2009;2010;2011;2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2024;2025;2026;2027;2028;2029;2030;2031;2032;2033;2034;2035;2036;2037;2038;2040;2041;2042;2043;2044;2045;2046;2047;2048;2049;2050;2051;2052;2053;2054;2056;2057;2058;2059;2060;2061;2062;2063;16000;16001;16002;16003;16004;16005;16006;16007;16008;16009;16010;16011;16012;16013;16014;16015;16016;16017;16018;16019;16020;16021;16022;16023;16024;16025;16026;16027;16028;16029;16030;16031;16032;16033;16034;16035;16036;16037;16038;16039;16040;16041;16042;16043;16044;16045;16046;16047;16048;16049;16050;16051;16052;16053;16054;16055;16056;16057;16058;16059;16060;16061;16062;16063;16064;16065;16066;16067;16068;16069;16070;16071;16072;16073;16074;16075;16076;16077;16078;16079;16080;16081;16082;16083;16084;16085;16086;16087;16088;16089;16090;16091;16092;16093;16094;16095;16096;16097;16098;16099;16100;16101;16102;16103;16104;16105;16106;16107;16108;16109;16110;16111;16112;16113;16114;16115;16116;16117;16118;16119;32000;32001;32002;32003;32004;32005;32006;32007;32008;32009;32010;32011;32012;32013;32014;32015;32016;32017;32018;32019;32020;32021;32022;32023;32024;32025;32026;32027;32028;32029;32030;32031;32032;32033;32034;32035;32036;32037;32038;32039;32040;32041;32042;32043;32044;32045;32046;32047;32048;32049;32050;32051;32052;32053;32054;32055;32056;32057;32058;32059'
[Veeam.Backup.Core.CObjectInJob]::Update($ObjectInfo)
}
Thanks!

dperabo
Influencer
Posts: 10
Liked: never
Joined: Aug 14, 2015 12:21 pm
Full Name: Daniel
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by dperabo » Jan 18, 2019 12:08 pm

Thanks a lot, I was thinking about this solution but i didn't think
it would put the hook (translate bei google :D )

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Jan 18, 2019 12:59 pm

You're welcome. Should other help be needed, feel free to reach us. Thanks!

rverhe
Influencer
Posts: 11
Liked: never
Joined: Dec 01, 2014 12:50 pm
Full Name: Rob Verhees
Contact:

[MERGED] Veeam Udpate 4 JobobjectDiskfilter

Post by rverhe » Feb 21, 2019 6:50 am

Goodmorning,

With Veeam Update 4 the jobobject diskfilter property is changed in PowerShell.
Have some issues with setting it to "selected disks", any idea how to archive this with the new commands?

When trying to change it, it says "ReadOnly Property"

Key DisplayName
--- -----------
IDE 0:0 (3000) IDE (0:0)
IDE 0:1 (3001) IDE (0:1)
IDE 1:0 (3002) IDE (1:0)
IDE 1:1 (3003) IDE (1:1)
SCSI 0:0 (2000) SCSI (0:0)
SCSI 0:1 (2001) SCSI (0:1)
SCSI 0:2 (2002) SCSI (0:2)

rverhe
Influencer
Posts: 11
Liked: never
Joined: Dec 01, 2014 12:50 pm
Full Name: Rob Verhees
Contact:

Re: Veeam Udpate 4 JobobjectDiskfilter

Post by rverhe » Feb 21, 2019 8:03 am

Update:

--> Current Diskfilter

PS C:\WINDOWS\system32> $jobobject.diskfilter

Disks DiskNamePatterns IsVer8Format
----- ---------------- ------------
{IDE (0:0), IDE (0:1), IDE (1:0), IDE (1:1)...} {} True

--> Created Diskfilter Object

PS C:\WINDOWS\system32> $an

Disks DiskNamePatterns IsVer8Format
----- ---------------- ------------
{SCSI (0:0)} {} True


PS C:\WINDOWS\system32> $jobobject.diskfilter = $an
The property 'diskfilter' cannot be found on this object. Verify that the property exists and can be set.

Or

PS C:\WINDOWS\system32> [Veeam.Backup.Core.CObjectInJob]::Update($an)
Cannot convert argument "oijInfo", with value: "Veeam.Backup.Core.CDiskFilter", for "Update" to type "Veeam.Backup.Model.CDbObjectInJobInfo": "Cannot convert the "Veeam.Backup.Core.CDiskFi
lter" value of type "Veeam.Backup.Core.CDiskFilter" to type "Veeam.Backup.Model.CDbObjectInJobInfo".

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Feb 21, 2019 10:42 am

What exact disks you have to have selected? Thanks!

jhoughes
Veeam Software
Posts: 94
Liked: 21 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by jhoughes » Feb 21, 2019 2:26 pm

I had shown someone how to do this recently to set a tag object as an exclude and used the Update method for this.

Post is here: post314628.html#p314628
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

rverhe
Influencer
Posts: 11
Liked: never
Joined: Dec 01, 2014 12:50 pm
Full Name: Rob Verhees
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by rverhe » Feb 22, 2019 9:44 am

Hello Guys,

I found how to change the diskfilter using PowerShell after Veeam 9.5 Update 4.
Edited my previous blog with my new findings:

http://robvit.com/veeam/backup_replicat ... powershell

theq77
Novice
Posts: 7
Liked: 1 time
Joined: Apr 02, 2019 3:06 pm
Full Name: theq
Contact:

[MERGED] Exclude Disk with powershell

Post by theq77 » Apr 16, 2019 3:48 pm

I want to exclude SCSI disks from a backup job.

I found this Information:
http://robvit.com/veeam/backup_replicat ... owershell/
powershell-f26/add-vm-s-to-exclusions-list-t21575.html

when I add the vm with
Add-VBRViJobObject -Job $jobname -Entities (Find-VBRViEntity -Name $vmname)
Get-VBRJobObject -Job $jobname -Name $vmname | Remove-VBRJobObject

I get the VM in Exclusions/VMs but not in Exclusions/Disks, where it should be.

Any ideas?

tia!

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Apr 16, 2019 7:19 pm

What exact SCSI disks you're trying to exclude (0:1, 0:2, etc.)? Or you're trying to exclude them all? Thanks!

jhoughes
Veeam Software
Posts: 94
Liked: 21 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by jhoughes » Apr 16, 2019 8:20 pm

The 'Remove-VBRJobObject' cmdlet will set the entire VM as an excluded object from a job.

If you are looking to exclude only specific disks, that is where you want to follow Rob's post about the DiskArray object creation and the Update method of the job object itself.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

theq77
Novice
Posts: 7
Liked: 1 time
Joined: Apr 02, 2019 3:06 pm
Full Name: theq
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by theq77 » Apr 17, 2019 7:33 am

Thx for the fast answers.
As I understand, I have to add the vm to the disk exclusion list and then add the SCSI disks.
While adding the SCSI disks works fine, I have an issue adding the vm.

When I add the VM via
Add-VBRHvJobObject -Job $JobName -Entities (Find-VBRHvEntity -Name $VM)
the machine also appears in the list 'Virtual Machines to backup' - but the vm is already in the list via the Cluster, which should be backuped. The VM is also in the "disk exclusion" list. That is good, because I can add the disks to be excludes. When I add the VM via the VEEAM Console, the VM is not in the 'Virtual Machines to backup' list, but only in the "disk exclusion" list!

When I Remove the VM via
Get-VBRJobObject -Job $jobname -Name $vm | Remove-VBRJobObject
the VM is not longer in the "Virtual Machines to backup" list - and it is also moved from the "disk exclusion" list to the "VM exclusion" list. So it is no longer possible to add a disk.

So my questions are:
* What do I have to do, to have the VM only in the "disk exclusion" list like it would be via the console?
* What is the impact of the vm beeing listed in "Virtual Machines to backup"

tia

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

Re: How do I set DiskFilter and other exclude parameters

Post by veremin » Apr 17, 2019 5:47 pm

Can you tell us whether you want to:

- Exclude a certain VM form processing
- Or exclude certain disk of certain VM from processing

Thanks!

theq77
Novice
Posts: 7
Liked: 1 time
Joined: Apr 02, 2019 3:06 pm
Full Name: theq
Contact:

Re: How do I set DiskFilter and other exclude parameters

Post by theq77 » Apr 18, 2019 6:36 am

I want to exclude certain disk of certain VM from processing.

In the backup Job the vm is not listed directly, but only the Cluster the vm is in.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests