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 »

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
Veteran
Posts: 7328
Liked: 781 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 »

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 »

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
Veteran
Posts: 7328
Liked: 781 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 »

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 »

So, how do you create tags for hyper-v vms? No option in BR console. Cant find this in helpcenter either.
Shestakov
Veteran
Posts: 7328
Liked: 781 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 »

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 »

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 »

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 »

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: 315
Liked: 74 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 »

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: 12
Liked: 4 times
Joined: Nov 24, 2014 4:27 pm
Full Name: Gairy Spiers
Contact:

Re: dynamically add vms to the right job

Post by gairys » 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 »

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: AdsBot [Google], Bing [Bot] and 274 guests