Comprehensive data protection for all workloads
Post Reply
ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

dynamically add vms to the right job

Post by ujan » Feb 16, 2018 8:49 am

Lets say I have Windows and Linux VMs on a host. Windows and Linux vms need different backup job settings. Every time a new VM added to the virtual host, it has to be administered twice in Veeam: removing and excluding from one job and adding to the other job.

There must be a way I suppose, that a new VM will be added to the right Veeam job based on a simple criteria, I just cant find how is this scenario built up in Veeam BR.

Thanks,
Jan

Shestakov
Veeam Software
Posts: 6915
Liked: 700 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: dynamically add vms to the right job

Post by Shestakov » Feb 16, 2018 8:51 am

Hello Jan and welcome to the community!
You may use VM containers(Tags, resource pools, VM folders etc.) as a source of backup job. It depends how you separate the VMs in your infrastructure. This way new VMs will be added automatically.
Thanks!

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 16, 2018 9:03 am

Great. Where can I create containers? Cant find an option in the console. It's a hyper-v cluster and that's the only container created automatically.

Shestakov
Veeam Software
Posts: 6915
Liked: 700 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: dynamically add vms to the right job

Post by Shestakov » Feb 16, 2018 9:16 am

Containers are to be created in Virtual Infrastructure. For Hyper-V I would recommend to use tags.
Assign one tag to Windows VMs, another to Linux ones and create Veeam backup jobs based on these tags.
Thanks!

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 17, 2018 9:51 am

So, how do you create tags for hyper-v vms? No option in BR console. Cant find this in helpcenter either.

Shestakov
Veeam Software
Posts: 6915
Liked: 700 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: dynamically add vms to the right job

Post by Shestakov » Feb 17, 2018 9:10 pm

Hyper-V tags are set on SCVMM, not Veeam Backup Server.
Do you manage SCVMM or individual hosts/clusters?
Thanks!

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 18, 2018 9:34 am

No SystemCenter. ITs just a simple 2node hyperv cluster, managed thru builtin win tools (Failover Cluster Manager snapin).

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 18, 2018 1:15 pm

Ok, so no builtin solution to this. I ended up using powershell. This is a simple infra I can just use a simple VM naming convention to differentiate Win & Lin VMs.

What I learned, you have all new VMs dynamically included to the "Infrastructure", so will included by the Job that includes the Infra container. Cool. However, a dynamically included VM cannot be excluded until it is added explicitly. So first add it, then remove it is the way to go. Then just simply add it to the right Job.

> Add-PSSnapin VeeamPSSnapin
> Connect-VBRServer
> Find-VBRHvEntity -name L* | Add-VBRHvJobObject -job "Windows Cluster Backup"
> Get-VBRJobObject -job "Windows Cluster Backup" -name L* | Remove-VBRJobObject #The trick here is that Remove defaults to Exclude only without modifiers
> Find-VBRHvEntity -name L* | Add-VBRHvJobObject -job "Linux Cluster Backup"
> Disconnect-VBRServer

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 18, 2018 1:54 pm

Small bug i guess, when adding and removing (that is excluding) the same VMs the second time those will be listed (excluded) twice in PS. In GUI they are listed just once. Any more time the script run excluded VMs remain listed twice. Beside that, it all looks good.

MichaelCade
Veeam Software
Posts: 277
Liked: 55 times
Joined: Mar 23, 2015 11:55 am
Full Name: Michael Cade
Location: Cambridge, United Kingdom
Contact:

Re: dynamically add vms to the right job

Post by MichaelCade » Feb 18, 2018 8:34 pm

You could use the datastore as the container to select the VMs to be added.
Regards,

Michael Cade
Global Technologist
Veeam Software
Email: Michael.Cade@Veeam.com
Twitter: @MichaelCade1

gairys
Influencer
Posts: 11
Liked: 3 times
Joined: Nov 24, 2014 4:27 pm
Full Name: Gairy Spiers
Contact:

Re: dynamically add vms to the right job

Post by gairys » Feb 19, 2018 1:34 pm 1 person likes this post

MichaelCade wrote:You could use the datastore as the container to select the VMs to be added.
I agree with MichaelCade. I have over 300 VMs in Hyper-V and 400 VMs in VMware, and using tags is a manual and boring process. We have tried a number of methods to optimize our processes and backup windows, including tags, folders, etc. People change tags, and sometimes the new tags are missed, unless you write a script nightly to check for tags outside of a list you already determined. Same goes for folders. But both platforms have one thing in common; the VMs have to live somewhere in storage. So we split Windows and Linux VMs into different datastores in each platform and base backups off the datastores. When a new VM is created, it lands in a datastore that already has a configured job, and it automagically gets backed up on the next backup job.

ujan
Novice
Posts: 9
Liked: never
Joined: Feb 16, 2018 8:32 am
Contact:

Re: dynamically add vms to the right job

Post by ujan » Feb 26, 2018 12:15 am

I see what you mean. Again, it's not possible with this small infra, I dont have that many disks to further split the arrays but I'll keep that in mind for the future. Thanks!

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 56 guests