Agile backup job assignment with VM-tags and Veeam Backup
Organizing VMs in backup jobs can be a tedious task. Especially when there is a larger number of VMs and multiple jobs. It might happen that you miss out a VM for a job, or have it doubled.
To check whether a VM is backed up by the corresponding jobs, you either have to go through the settings of every single job or use smart tools like Veeam-One.
There are a couple of ways to add VMs to a backup job. You can choose single VMs by name, or select an entire VM folder, resource-pool or datastore. But one of the most sophisticated and versatile methods is to leverage VM-tags for selection.
What are tags?
A tag behaves like a label or a sticker that you put on a VM. It defines a property or a membership of a given VM. Think of a tag that marks a VM for daily backup. A second tag might mark a VM for hourly or weekly backup. You don’t have to adjust your backup jobs twice a week to remove or add new virtual machines. With VM-tags you don’t have to touch backup jobs at all. Just tell the job once to select all VMs with a specific tag and you’re done.
Even checking job membership for a VM is easier with tags. Just have a look at its tags.
I will now show a simple example how to use tagged VMs in combination with Veeam Backup & Replication.
Create a category
A categorie is basically a collection of tags and it’s quite helpful to organize them.
A backup category is just one example of many. You might also create a category for firewall rules, group memberships, ownership and many more.
So, now let’s create a category called “Backup”.
You can choose the object types to which the tags can be attached. Of course it’s possible to attach a tag on any object. But let’s keep it simple. We only choose VMs as object types.
The second important choice is cardinality. Either you choose one tag per object (VM) or many tags per object. In our case it might be useful to have more than one tag per object. Think of a tag for daily backup and another one for weekly backup. A VM could be member of both jobs.
We now see our new category “Backup”.
If we change view from categories to tags, we can add a new tag. We give a name and a description and finally choose one of the existing categories.
In this example we’ll define two different tags. One for daily backups and one for weekly backups.
There are basically two ways to assign tags. Either with the webclient / vSphere-Client, or by PowerCLI. The latter method is ideal for assigning tags to a large group of VMs.
It is possible to select a single VM or many VMs and attach a tag.
We’ve selected more than one object. That’s why there is a warning.
Open PowerCLI and connect to vCenter.
Let’s say we’d like to tag all VMs whose name starts with “VDI-” for weekly backups.
$vms = Get-VM VDI-* $tag = Get-Tag -Name 'SLA_weekly' $vms | New-TagAssignment -Tag $tag
That’s very convenient if you have uniform VM names that differ just in a number.
Using VM-tags to manage job membership, gives you more agility and is less error prone to fulfill your backup SLAs.