VCP-CMA 2024 Question 211
Single answerYou are tasked with creating a VMware Aria Automation template to deploy a virtual machine with an NSX-T On-Demand Network. The requirements specify the following: 1) the network should be created dynamically during deployment, 2) the YAML file must include an input for the machine name, and 3) a constraint tag should be applied to ensure the network uses a specific network profile. Which YAML code snippet correctly meets these requirements?
- A
inputs: machine_name: type: string resources: myVM: type: Cloud.Machine properties: name: ${input.machine_name} myNetwork: type: Cloud.NSX.Network properties: networkType: existing tags: - key: environment value: production
- B
inputs: machine_name: type: string resources: myVM: type: Cloud.Machine properties: name: ${input.machine_name} myNetwork: type: Cloud.NSX.Network properties: networkType: existing
- C
inputs: machine_name: type: string resources: myVM: type: Cloud.Machine properties: name: ${input.machine_name} networks: - network: '${resource.myNetwork.id}' myNetwork: type: Cloud.NSX.Network properties: networkType: on-demand constraints: - tag: 'network:profile=prod'
- D
inputs: machine_name: type: string resources: myVM: type: Cloud.Machine properties: name: ${input.machine_name} networks: - network: '${resource.myNetwork.id}' myNetwork: type: Cloud.NSX.Network properties: networkType: on-demand constraints: - tag: 'security:profile=prod'
Show answer and explanation
Correct answer: C
Explanation
The correct option must dynamically create an NSX-T On-Demand Network (networkType: on-demand) and include a constraint tag to ensure the network uses a specific network profile ('network:profile=prod'). Additionally, the virtual machine must reference the dynamically created network using '${resource.myNetwork.id}'. Option 3 satisfies all these requirements, making it the correct choice.
- A. Incorrect.
This option incorrectly specifies the networkType as 'existing', which does not meet the requirement for an on-demand network. Additionally, the constraint tag is not properly applied to the network profile.
- B. Incorrect.
This option does not meet the requirement for the network to be dynamically created (on-demand networkType is missing) and lacks any constraint tags.
- C. Correct.
This option correctly specifies the networkType as 'on-demand', includes a valid constraint tag for the network profile ('network:profile=prod'), and links the machine to the dynamically created network via '${resource.myNetwork.id}'. It fully meets the requirements.
- D. Incorrect.
This option specifies an incorrect constraint tag 'security:profile=prod' instead of the required 'network:profile=prod', which invalidates the configuration for the network profile.