VMware Cloud Community
filencho
Contributor
Contributor

Static and Dynamic IP Address Assignment in vRA 8.2

I have a blueprint that has four inputs: Number of Windows 2019 Machines, Number of CentOS7 Machines, Domain Joined, and Network. For the networks, there are two options. One is a static network and the other is a dynamic DHCP network. The way I'm thinking of approaching this is to toggle the assignment property under the network from static to dynamic based on the input. I think I need to use the '${map_by} function but I'm unsure of the syntax. Below is a sample of the .yaml for the CentOS VM.

Was thinking maybe something like this in place of static below: '${map_by(input.Network[Network: Demo Routed] => {"static"}}'

 

CentOS7:
type: Cloud.vSphere.Machine
properties:
image: CentOS7
count: '${input.CentOS7Count}'
customizationSpec: CentOS
osType: LIN
cpuCount: 2
totalMemoryMB: 2048
Username: '${env.requestedBy}'
networks:
- network: '${resource.Cloud_vSphere_Network_1.id}'
assignment: static

 

 

Reply
0 Kudos
1 Reply
filencho
Contributor
Contributor

I found my own answer. The expression below worked like a charm. 

'${input.Network == "Network: Demo Routed" ? "static" : "dynamic"}'

This basically said if the input called Network is equal to Network: Demo Route make this field "Static" else make it "Dynamic"

Documentation: https://docs.vmware.com/en/VMware-Cloud-Assembly/services/Using-and-Managing-VMware-Cloud-Assembly.p...

Reply
0 Kudos