VMware Cloud Community
machagogo
Contributor
Contributor

How to use Custom Form to add or Not add a second nic to VM Blueprint

I am using Custom Form logic to determine the Network Path for Network0 in a Blueprint request.  Works great.

In the form I also have a boolean value asking whether a Backup network interface is required.  If "Yes", the Custom Form logic populates VirtualMachine.Network1.Name with the appropriate Network Path, and this too works fine. Problem is that I don't have a way to not assign a Network1 if the boolean value is "No".  With "No", the request will fail with "No reservation available that has all specified networks: network-PG and ."  (second specified network is <blank>)

The error makes sense, but is there a way to use Custom Form logic to add or not add a Network1 interface in the initial VM request stage, or would that decision have to be made during a later lifecycle stage after the VM has been provisioned (with only Network0) from blueprint?

0 Kudos
1 Reply
machagogo
Contributor
Contributor

I think I answered my own question. 

I removed the VirtualMachine.Network1 custom properties from the blueprint but the reference for VirtualMachine.Network1.Name remained in the Custom Form, which I did not change.  Now when I submit requests and choose "yes" or "no", the second virtual nic does or does not get created as expected.

0 Kudos