Host-based backup of VMware vSphere VMs.
Post Reply
J.Haatainen
Novice
Posts: 9
Liked: 5 times
Joined: Oct 27, 2014 6:36 pm
Contact:

Using TAGs in Backup jobs

Post by J.Haatainen »

Hi!

Do you know if it's possible to do advanced automation on Backup Job with Tags?

Now in v8, it's possible to backup VM's depending on what TAG that VM has, but, as far as i know, I can't combine those tags.

To explain my need:
I have two SQL servers, production and testing.
Production server has tags "Env: PRODUCTION" & "Type:SQL"
Test server has tags "Env: TEST" & "Type:SQL"

Then I have servers like
Production APP with tags "Env: PRODUCTION" & "Type:Application"
Test APP with tags "Env: TEST" & "Type:Application"


And I want to create backup job, that takes backup of all production SQL servers.

But, if in backup job, I use tag SQL, it will backup also test SQL server. And if I use tag PRODUCTION, it will backup also Application server.

So what I want to do, is a backup job with rule that combines TAG:SQL & TAG:Production. Is that possible, or do I still need to use Powershell to do this?

Even more what I'd like to do, is to combine tags with other attributes, like Tags & Clusters etc, it would be really easy to do nicely automated backup jobs, if that would be possible :)

Regards,
Janne
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Using TAGs in Backup jobs

Post by Vitaliy S. »

Hi Janne,

Tags are combined with "OR" operator in the job, so if you add one tag all VMs that have this tag will be backed up. As a workaround, you may want to create extra tag (3rd one) for all SQL Servers in production and then add this tag to the backup job as a source.

P.S. you can automate tags creation via Veeam ONE Business View categorization rules.

Hope it helps!
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Using TAGs in Backup jobs

Post by veremin »

To explain my need:
I have two SQL servers, production and testing.
Production server has tags "Env: PRODUCTION" & "Type:SQL"
Test server has tags "Env: TEST" & "Type:SQL"

Then I have servers like
Production APP with tags "Env: PRODUCTION" & "Type:Application"
Test APP with tags "Env: TEST" & "Type:Application"

And I want to create backup job, that takes backup of all production SQL servers.
I'm not sure, but what if you try to add TAG SQL to the job source and and TAG TEST to the job exclusions? In this case, only one server out of four provided ones would match the specified settings; which seems to be the exact situation you're willing to achieve.

Thanks.
dellock6
VeeaMVP
Posts: 6166
Liked: 1971 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Using TAGs in Backup jobs

Post by dellock6 »

Hi, just checked in my lab, at this time when you select a Tag for backups, exclusions can only be applied to specified VMs that have that tag.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
J.Haatainen
Novice
Posts: 9
Liked: 5 times
Joined: Oct 27, 2014 6:36 pm
Contact:

Re: Using TAGs in Backup jobs

Post by J.Haatainen »

Ok, thank's to you all for quick reply.

That clarified that what I need to do. That example was actually quite a lot simplified from my real life situation, but I will start to build up a powershell script to achieve my needs.

If I manage to get it working, I will post it to forums :)

Regards,
Janne
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Using TAGs in Backup jobs

Post by veremin »

Using PowerCLI commandlets, it shouldn't be that hard to achieve your goal. Something like the following should allow you to get list of corresponding VMs that can be added to a backup job then.

Code: Select all

Get-VM | where {$_.Tag -eq "Tag1" -and $_.Tag -eq "Tag2"} 
Thanks,
Gostev
Chief Product Officer
Posts: 31814
Liked: 7302 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Using TAGs in Backup jobs

Post by Gostev »

Why not manage this at tag level instead? For example, create 3rd tag on all VMs which have required 1st and 2nd tag, and use 3rd tag to populate the job? There is pretty much no limit to amount of categories and tags you can have on the VM... and you can fully automate this process with Veeam Business View (which is free).
kylemartin901
Novice
Posts: 6
Liked: 2 times
Joined: Nov 13, 2011 9:37 pm
Full Name: Kyle Martin
Contact:

Re: Using TAGs in Backup jobs

Post by kylemartin901 »

How would you use Veeam One to assign the 3rd tag to a VM based on the conditions of the 1st and 2nd tag that would be able to be used by to create the Veeam backup job?

eg The backup job uses the tag "Backup Job: Production SQL" how do you get Veeam One to set the tag "Backup Job: Production SQL" to the VMs if they contain the tags "Env: PRODUCTION" AND "Type:SQL"

If I try to use rules there is no selection to use VM tags when you select object type VMs and Type properties. If I try to use Groups you can't use AND or OR conditions in your expressions.
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Using TAGs in Backup jobs

Post by Vitaliy S. »

Hi Kyle,

If you want to use existing tags, then dynamic groups should be your choice. Can you please post me the example of regular expression you want to use as it should be possible in v9?

Thanks!
kylemartin901
Novice
Posts: 6
Liked: 2 times
Joined: Nov 13, 2011 9:37 pm
Full Name: Kyle Martin
Contact:

Re: Using TAGs in Backup jobs

Post by kylemartin901 »

Thanks Vitaliy,

I am trying to put in place a system similar to that proposed by Luca in https://www.veeam.com/wp-advanced-polic ... -tags.html

I have created a dynamic group called "Backup Job" and would like to use an expression like this example to build out my backup job tags based on the policy tags.

Code: Select all

CASE 
WHEN ((Tag("Application Quiescence") = "Quiescence YES") AND (Tag("Backup Encryption") = "Encryption NO") AND (Tag("RPO") = "RPO 24 Hour") AND (Tag("OS") = "Windows")) THEN "Windows non encrypted 24 hour non application aware backup" 
ELSE "" 
END 
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Using TAGs in Backup jobs

Post by Vitaliy S. » 1 person likes this post

Ok, got it! Backup does not allow choosing AND/OR operators, but in Veeam ONE you can create additional tag for this use case. This new tag will have data about both tags.
dellock6
VeeaMVP
Posts: 6166
Liked: 1971 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Using TAGs in Backup jobs

Post by dellock6 »

And so you know Kyle, the request to have the AND boolean operator in tags management in addition to OR has been submitted different times by other customers, so your feedback counts towards the chance to have this improvement in one of the following next releases. Thanks!
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
kylemartin901
Novice
Posts: 6
Liked: 2 times
Joined: Nov 13, 2011 9:37 pm
Full Name: Kyle Martin
Contact:

Re: Using TAGs in Backup jobs

Post by kylemartin901 » 1 person likes this post

Thanks,

I worked out I could use the string concatenation operator "+" to add all the tag categories into a single string and then do an equality on that string.

Code: Select all

CASE 
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption NORPO 24 HoursQuiescence YES" THEN "Windows non encrypted 24 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption NORPO 24 HoursQuiescence YES" THEN "Linux non encrypted 24 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption YesRPO 24 HoursQuiescence YES" THEN "Windows encrypted 24 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption YesRPO 24 HoursQuiescence YES" THEN "Linux encrypted 24 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption NORPO 12 HoursQuiescence YES" THEN "Windows non encrypted 12 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption NORPO 12 HoursQuiescence YES" THEN "Windows non encrypted 12 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption YesRPO 12 HoursQuiescence YES" THEN "Windows encrypted 12 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption YesRPO 12 HoursQuiescence YES" THEN "Windows encrypted 12 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption NORPO 1 HourQuiescence YES" THEN "Windows non encrypted 1 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption NORPO 1 HourQuiescence YES" THEN "Windows non encrypted 1 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "WindowsEncryption YesRPO 1 HourQuiescence YES" THEN "Windows encrypted 1 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "LinuxEncryption YesRPO 1 HourQuiescence YES" THEN "Windows encrypted 1 hour application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption NORPO 24 HoursQuiescence NO" THEN "Non encrypted 24 hour non application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption YESRPO 24 HoursQuiescence NO" THEN "Encrypted 24 hour non application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption NORPO 12 HoursQuiescence NO" THEN "Non encrypted 12 hour non application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption YESRPO 12 HoursQuiescence NO" THEN "Encrypted 12 hour non application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption NONRPO 1 HourQuiescence NO" THEN "Non encrypted 1 hour non application aware backup"
WHEN (Tag("OS Type") + Tag("Backup Encryption") + Tag("RPO") + Tag("Application Quiescence")) = "Encryption YESRPO 1 HourQuiescence NO" THEN "Encrypted 1 hour non application aware backup"
WHEN Tag("RPO") = "RPO No Backup" THEN "No Backup"
ELSE "Non encrypted 24 hour non application aware backup"
END
svenh
Enthusiast
Posts: 30
Liked: 5 times
Joined: Jan 21, 2016 12:56 pm
Full Name: Sven Hartge
Location: Germany
Contact:

[MERGED] Feature Suggestion: VM selection by multiple condit

Post by svenh » 1 person likes this post

Hi!

I want to suggest a feature to allow for a more fine grained selection of VMs to backup, built upon already available features: Folders and Tags.

Right now I can select a folder to backup and then exclude VMs based on folders, storages and tags.

But what I am missing for full flexibility is to be able to select VMs based on folder AND tags combined.

Example: A folder structure with a folder for every department. Inside each folder there are VMs with different tags. I now want to be able to create a job which backups every VM from folder "Dept-X" AND "Tag: Important" and another Job which backups VMs from folder "Dept-X" AND "Tag: Linux", etc.

Right now I have to have a quite complex exclusion list, being able to just use an AND conjunction would be much easier.
foggy
Veeam Software
Posts: 21139
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Using TAGs in Backup jobs

Post by foggy »

Hi Sven, your request is accepted. Above you can find some hints on how to work around this limitation.
svenh
Enthusiast
Posts: 30
Liked: 5 times
Joined: Jan 21, 2016 12:56 pm
Full Name: Sven Hartge
Location: Germany
Contact:

Re: Using TAGs in Backup jobs

Post by svenh »

I see. Quite the complicated work-around, but a work-around nonetheless. I will need to play a bit with Veem One to get this going.
Vitaliy S.
VP, Product Management
Posts: 27377
Liked: 2800 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Using TAGs in Backup jobs

Post by Vitaliy S. »

If you need any assistance with dynamic group expressions, feel free to post your questions in the dedicated Business View sub-forum.
daphnis
Enthusiast
Posts: 47
Liked: 3 times
Joined: Jun 13, 2012 7:01 pm
Contact:

Re: Using TAGs in Backup jobs

Post by daphnis » 1 person likes this post

I want to add a +1 to the enhancement to backup job groupings by vSphere tags so that we can choose between the AND and OR operators. Simple logic like this should be allowable without having to fall back to PowerShell or anything outside of the UI. Surfacing this type of selection through BEM would also be useful.
Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests