VMware Cloud Community
brtlvrs
Enthusiast
Enthusiast

Is it possible to exclude tag key in a constraint on a cloud template

Hi,

We are trying to have a dynamic constrained in a cloud template.
Is it possible to exclude a tag key (category) as a constrianed.

For example.
constrains:

- tag: !vegetables

vs

- tag: vegetables: oranges (yes I know... )

So a constraint would be, or the resources tagged with vegatbles:oranges , or the resources not tagged with any vegetables tag
What would be the right solution for this ?

Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Labels (4)
Reply
0 Kudos
4 Replies
bdamian
Expert
Expert

Hi, yes. As you can see in the documentation (https://docs.vmware.com/en/vRealize-Automation/8.0/Using-and-Managing-Cloud-Assembly/GUID-C8C335F4-9...), you can use:

[!]tag_key[:tag_value][:hard|:soft]

You can add a "deny" symbol at the beginning,  then the key, and optionally you can add a value, and hard|soft modifier. By default, tags are "hard" which means "or tag or error". "Soft" means "if has the tag, the better".

 

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
Reply
0 Kudos
bdamian
Expert
Expert

Oh, sorry. I misunderstand your question. Do you want to exclude any tag value for a given tag key... 

I've tried some options but I've couldn't find a way to do that. 

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
Reply
0 Kudos
brtlvrs
Enthusiast
Enthusiast

Yes correct.

I want a constraint defined that a certain tag cannot be used as a capacity tag.

Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Reply
0 Kudos
Ankush11s
VMware Employee
VMware Employee

you could achieve this using below
take an input variable and whose value comes from external vRO action .

Map that variable to constraint tag
you can handle the logic in vRO to skip or provide default value for that variable .

 

 

Reply
0 Kudos