Skip to main content

New in v11: combine vSphere tags

  • December 17, 2020
  • 19 comments
  • 1592 views

vNote42
Forum|alt.badge.img+12
  • On the path to Greatness
  • 1246 comments

@PValsecchi already showed how to use vSphere tags for VM selection in VBR. New in v11 is the possibility to combine vSphere tags. I want to show how this work.

 

For that, I created two tag categories. One for Location and one for Backup. I defined datacenter A and B locations; and Gold, Silver and Bronze backup priority.

 

These tags are assigned to my 4 test VMs:

So: VM01 and VM03 (odd numbers) are located in DC A. VM02 and VM04 (even numbers) are in DC B. VM01 and VM02 are defined for Gold-Backup, VM03 for Silver, VM04 for Bronze.

 

First, I select one Tag for VM selection: DC A. This can be done either with single tag selection or with new combination of tags but just select one.

As expected, when backup runs, VM01 and VM03 are selected:

Next, I want to backup all Gold-Backup VMs in DC B and select these tags:

 

Objects shown in Job definition:

Just VM02 has all tags assigned:

 

Fine, works as expected! And now, backup all VMs in DC A and B:

Eventually here is a pitfall. Because now nothing will be backed up:

 

Simple because no VM can be in DC A and B simultaneously - at lease not with the definition of my tags. To backup all DC A and B VMs, select single tags as usually:

All VMs in both DCs are selected:

Important: at the moment just AND combinations are supported

19 comments

JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • 2687 comments
  • December 18, 2020

This is a fine way to define a structure for automatic selection of VMs to Jobs. Great extension of this functionality.

Is there a mechanism in VMWare to be sure that the tags have to be set at the creation of a VM? Otherwise the admins will forget it for most of the maschines… :smiley:


MicoolPaul
Forum|alt.badge.img+23
  • 2425 comments
  • December 18, 2020

This is great, and thanks for breaking down the logic of the tag combination as you did, it was great to see that example of selecting both DCs!


regnor
Forum|alt.badge.img+14
  • Veeam MVP
  • 1387 comments
  • December 18, 2020

@JMeixner: I don’t know any. But as a workaround you could create a catch-all job, which backups only VMs without tags. Or create a scheduled PowerCLI script which reports VMs without tags or assigns a default tag to those.

Seeing the example with the two DCs I fear that this can easily happen and result in missing backups. Double checking or reporting will be a must if using tag combinations.


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 18, 2020

Yes it is quite easy to query for not-tagged VMs. Simple like this:

$NotTaggedVMs = @()
Get-VM | ForEach-Object {if((Get-TagAssignment $_) -eq $null) {$NotTaggedVMs += $_}}

I normally start such a script scheduled. It could tag VMs or report per mail. 


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 18, 2020

@JMeixner Actually there is solution for this: VMware Event Broker Appliance. It is currently a fling (no support) that is still in development. Just a few days ago, version 0.5 was released. It uses a new approach: Event driven automation. In this example, a tag is assigned to a new VM, when the event of VM-creation appears.

I personally believe, this will be part of vSphere one day.


JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • 2687 comments
  • December 18, 2020

Thank you for the code snippet, @vNote42 

And the hint to the Event Broker Appliance is great, too. I will suggest ths to our VMWare Admins.


haslund
Forum|alt.badge.img+14
  • Mr. VMCE
  • 396 comments
  • December 20, 2020

The VMware Event Broker Appliance sounds great! Will need to test this out soon.


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 21, 2020

The VMware Event Broker Appliance sounds great! Will need to test this out soon.

Please share your experiences here. :grin:


MicoolPaul
Forum|alt.badge.img+23
  • 2425 comments
  • December 21, 2020

The VMware Event Broker Appliance sounds great! Will need to test this out soon.

+1 on this, every day’s a school day!


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 21, 2020

The VMware Event Broker Appliance sounds great! Will need to test this out soon.

+1 on this, every day’s a school day!

And almost every day is too short ...


gulzarshaikhveeam
Forum|alt.badge.img+1
  • Experienced User
  • 140 comments
  • February 19, 2021

Yes it is quite easy to query for not-tagged VMs. Simple like this:

$NotTaggedVMs = @()
Get-VM | ForEach-Object {if((Get-TagAssignment $_) -eq $null) {$NotTaggedVMs += $_}}

I normally start such a script scheduled. It could tag VMs or report per mail. 

This will help me for sure


gulzarshaikhveeam
Forum|alt.badge.img+1
  • Experienced User
  • 140 comments
  • February 19, 2021

Thanks a lot for the wonderful write-up. I always encourage people to use TAGs as it's a brilliant way to manage your VMs and your backups. I also tend to TAG the VMs that require Copy/Replication as normally we don't replicate/Copy everything to DR. 


  • New Here
  • 1 comment
  • February 2, 2022
One problem I see with tags is that they don't allow you to set an execution order within the tag itself. Is that so?

JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • 2687 comments
  • February 2, 2022
One problem I see with tags is that they don't allow you to set an execution order within the tag itself. Is that so?

You are speaking of the order the VMs are processed within a job?


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • February 2, 2022
One problem I see with tags is that they don't allow you to set an execution order within the tag itself. Is that so?

This is not completely true! You can order the tags within the selection. If you need to backup your most important VMs first, you can add them explicitly by selecting them beneath your tags.

 


vergoted
Forum|alt.badge.img+1
  • Comes here often
  • 25 comments
  • February 4, 2022

A tag on your datastore can cover this as well.
Newly created vm’s on that datastore are automatically in back-up with the job.


marcofabbri
Forum|alt.badge.img+12
  • On the path to Greatness
  • 994 comments
  • February 9, 2022

Another great chapter @vNote42 , I admit not using tags enough...

@JMeixner Actually there is solution for this: VMware Event Broker Appliance. It is currently a fling (no support) that is still in development. Just a few days ago, version 0.5 was released. It uses a new approach: Event driven automation. In this example, a tag is assigned to a new VM, when the event of VM-creation appears.

I personally believe, this will be part of vSphere one day.

Are you using this tool even in production or only for testing prouposes?


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • February 9, 2022

Another great chapter @vNote42 , I admit not using tags enough...

@JMeixner Actually there is solution for this: VMware Event Broker Appliance. It is currently a fling (no support) that is still in development. Just a few days ago, version 0.5 was released. It uses a new approach: Event driven automation. In this example, a tag is assigned to a new VM, when the event of VM-creation appears.

I personally believe, this will be part of vSphere one day.

Are you using this tool even in production or only for testing prouposes?

For production purpose I am waiting for the final version of the broker .. it is still a fling


  • New Here
  • 3 comments
  • September 22, 2023

 

Nice!