Feature request: exclusions filters

PowerShell script exchange

Feature request: exclusions filters

Veeam Logoby rimvydukas » Fri Jun 21, 2013 7:43 am

Another feature request :) Lets imagine that I have two backup jobs created. One job archives Windows VMs and another Linux VMs. With currecnt program implementation I'm able to achieve this if I'll exclude all Linux machines in one job and if I'll exclude all Windows machines in another job. As I can understand - I must do all of these exclusions manualy or am I wrong? It would be nice to have some kind of exclusions filtering ability, for example I salect to archive one esx host and apply filter to skip all Linux machines. So in case when someone will create new linux machine it will be skiped automaticly by the job which archives windows machines. I'll not be forced to make any exclusions by myself.
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Fri Jun 21, 2013 8:16 am

Unfortunately, it’s not possible with the current VB&R version. However, you can always become a little creative and utilize custom PS script that, once executed, will find and exclude any linux/window machine present within a given job.

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

Re: Feature request: exclusions filters

Veeam Logoby rimvydukas » Fri Jun 21, 2013 9:20 am

Can you point me to such a script:) And then again - maybe another feature request?:)
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Fri Jun 21, 2013 1:03 pm

The discussion has been moved to the corresponding sub forum.

Can you point me to such a script


Yep, the following script might answer your requirements:

Code: Select all
Asnp VMware.VimAutomation.Core
Asnp VeeamPSSnapin
Connect-VIServer -Server "Name of your vCenter" -User "User name" -Password "Password"
$Objects = Get-VBRJob -name "Name of your job" | Get-VBRJobObject
Foreach ($Object in $Objects)
{
   If (((Get-VM -name $Object.name | Get-View).summary.config.guestFullName) -notmatch "Windows")
   {
    $Object | Remove-VBRJobObject
   }
}   


This script will exclude from a given job VMs which operating system isn’t Windows.

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: Feature request: exclusions filters

Veeam Logoby rimvydukas » Tue Jun 25, 2013 9:27 am

Thank you for this script very much. Bu I hope that you'll be able to implement more advanced filtering options via GUI in the near future:)
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Tue Jun 25, 2013 9:31 am

Glad that you find this script useful. As to the features, all of them are prioritized in accordance with customers’ demand. So, thank you for the feedback; much appreciated.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Feature request: exclusions filters

Veeam Logoby rimvydukas » Wed Jun 26, 2013 2:02 pm

Ok, tried this script. It seems that it works, but....

...but problem is that my job has two esx servers selected and not virtual machines selected. In that case script does not work. What are my options then?
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Wed Jun 26, 2013 2:13 pm

...but problem is that my job has two esx servers selected and not virtual machines selected

You mean that ESX(i) hosts where given VMs reside on have been added to backup console as standalone host and not as a part of vCenter? Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Feature request: exclusions filters

Veeam Logoby rimvydukas » Wed Jun 26, 2013 2:20 pm

v.Eremin wrote:You mean that ESX(i) hosts where given VMs reside on have been added to backup console as standalone host and not as a part of vCenter? Thanks.


No,

All of ESX servers are part of vcenter server. Problem is, that when I create backup job I select ESXi servers to backup (virtual machines to backup window), not individual VM machines. I want to have a flexible situation - when new VM appears on this esxi - it is backed up automatically without any additional intervention. And in this case script doesn't work, as it expects to have VMs in job settings and not ESXi servers.
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Thu Jun 27, 2013 11:14 am

Then, it seems that there is no supported way how you can achieve it. For now you can probably take the following algorithm and implement it in your script, however, do it on your own risk:

Code: Select all
Asnp VMware.VimAutomation.Core
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of Your backup Job"
$Repo = Get-VBRBackupRepository -name "Name of your Repository"
$Server = Get-VBRServer -name "Name of your ESX(i) host"
$ESXServer = Get-VBRJob -name $Job.name | Get-VBRJobObject
Connect-VIServer -Server $ESXServer.name -User "User" -Password "Password"
$Object = Get-VM | where {(($_ |Get-View).summary.config.guestFullName) -notmatch "Windows"}
$ObjectsToExclude = Find-VBRViEntity -Server $Server -name $Object.name
Add-VBRViBackupJob -Name "Temprorary Job" -BackupRepository $Repo -Entity $ObjectsToExclude
$Job1 = Get-VBRJob -name "Temprorary Job"
Foreach ($VmToExclude in ($Job1 | Get-VBRJobObject))
{
$VmToExclude.name
[Veeam.Backup.Core.CObjectInJob]::CreateViOij($Job.Id.guid, $VmToExclude.Object.Id.Guid, $VmToExclude.info.folderId, $VmToExclude.info.VssOptions, $VmToExclude.info.ApproxSize, $VmToExclude.info.Location, $VmToExclude.info.type,$VmToExclude.info.DiskFilter, $False)
$Objects = Get-VBRJob -name $Job.name | Get-VBRJobObject | ?{$_.name -eq $VmToExclude.name}
$Objects | Remove-VBRJobObject
$Objects.delete()
}
Remove-VBRJob -Job $Job1 -Confirm:$False


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: Feature request: exclusions filters

Veeam Logoby rimvydukas » Mon Jul 01, 2013 5:17 am

Ok, thanks for the script, I'll try to understand it:) But please, implement more advanced filtering in your product:)
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

Re: Feature request: exclusions filters

Veeam Logoby v.Eremin » Mon Jul 01, 2013 10:40 am

Ok, thanks for the script, I'll try to understand it:)

Feel free to ask any question and I will be glad to assist you in your understanding.

Generally speaking, I’ve just implemented the algorithm mentioned above. So:

• Firstly, it connects to ESX(i) server and finds VMs which OS isn’t windows.
• Secondly, a temp job is being created (“Temporary job”)
• Thirdly, VMs collected at step 1, are added to the temp job.
• Fourthly, for each VM script creates object of the ”CObjectInJob” type.
• Fifthly, these objects are excluded from a given job.
• Finally, the temp job is deleted.

But please, implement more advanced filtering in your product:)

Got your point. :) Thanks again for the feedback.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Feature request: exclusions filters

Veeam Logoby talanx » Tue Jul 23, 2013 5:05 pm

Put the Windows VM's in one folder and the Linux VM's in another folder.
Exclude the Linux VM's folder from the Windows Job.
Exclude the Windows VM's folder from the Linux Job.
talanx
Lurker
 
Posts: 1
Liked: never
Joined: Mon Nov 12, 2012 7:29 pm

Re: Feature request: exclusions filters

Veeam Logoby rimvydukas » Wed Jul 24, 2013 4:49 am

I use folders for a logical grouping of my VMs, so I can't do that.
rimvydukas
Enthusiast
 
Posts: 92
Liked: 5 times
Joined: Tue Jun 04, 2013 8:15 am

[MERGED] : Exclude VM's from job that backs up entire Cluste

Veeam Logoby decoy5657 » Wed Oct 09, 2013 3:51 pm

I have a job that backs up an entire cluster named "Development" - I need to be able to add exclusions to this job based on the name of the machine. IE, I want to exclude machines that match
Code: Select all
"*b"


I have gotten some scripts that work, but only if the "objects in the job" are a full list of virtual machines, which isn't much help since my only object is an entire cluster.

any help would be appreciated.
decoy5657
Influencer
 
Posts: 12
Liked: 3 times
Joined: Wed Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson

Next

Return to PowerShell



Who is online

Users browsing this forum: robbysmith and 7 guests