VMware Cloud Community
kphil22
VMware Employee
VMware Employee

vRA 8 YAML Dynamic Condition Evaluation

Hello,

We have distributed datacenters and we use different customization specs based on location and operating system. When trying to assign the customization spec, I tried to use evaluative conditions to land on the right customization spec.

Cloud Template YAML:

customizationSpec:
- ${input.location == 'Datacenter-East' & input.os == 'Windows-2019-Standard' : Datacenter-East-W2K19-vRA}'
- ${input.location == 'Datacenter-West' & input.os == 'Windows-2019-Standard' : Datacenter-West-W2K19-vRA}'
- ${input.location == 'Datacenter-East' & input.os == 'RHEL 8' : Datacenter-East-Linux}'
- ${input.location == 'Datacenter-West' & input.os == 'RHEL 8' : Datacenter-West-Linux}'

When trying to test the deployment I get an error which is very vague but I am 100% convinced it is due to improper syntax. Can someone please provide a good example for how to do this?

Error:

vCenter failure received while performing the operation, A specified parameter was not correct: name.

Tags (1)
0 Kudos
1 Reply
bdamian
Expert
Expert

I would tackle this problem in a different way.

First, "customizationSpec" expects a string, not a list: 

bdamian_0-1661863049862.png

And I would make some changes to the names of the CustomizationSpecs in vCenter. Based on your example:

  • Datacenter-East-Windows-2019-Standard
  • Datacenter-West-Windows-2019-Standard
  • Datacenter-East-RHEL 8
  • Datacenter-West-RHEL 8

And then, try something like this in the template:

customizationSpec: "${input.location}-${input.os}"

Of course this depends on how many OS do you have. But the important thing is that you can solve a problem in different ways in vRA8.

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