I have created catalog which the user can select between dhcp / static enabled networks.
I’m trying to then pass that on to the config in the catalog under:
networkInterfaces: [
{
primaryInterface: true,
network: {
id: “<%= customOptions.parsedNetwork %>”,
hasPool: false,
idName: PR25.2
},
ipMode: “”,
showNetworkPoolLabel: false,
showNetworkDhcpLabel: true
}
Changing to:
networkInterfaces: [
{
primaryInterface: true,
network: {
id: “<%= if (customOptions.input_vm_networkoptions == ‘NO’)(customOptions.parsedNetwork) else {if (input_vm_networkoptions == ‘YES’)(customOptions.parsedNetwork2)} %>”,
hasPool: false,
idName: PR25.2
},
ipMode: “”,
showNetworkPoolLabel: false,
showNetworkDhcpLabel: true
}
However it fails with failed to create server: Cannot set property ‘name’ on null object
parsedNetwork is the fieldname of the DHCP Vlan selected.
parsedNetwork2 is the fieldname of the static Vlan selected.
I don’t believe the value is working, any ideas why it’s failing?
Also I have another field generated for an IP address if static vlan selected.
I presume if I add “ipAddress” within networkinginterfaces, would this be suffient or are there other fields required?
networkInterfaces: [
{
primaryInterface: true,
network: {
id: “<%= if (customOptions.input_vm_networkoptions == ‘NO’)(customOptions.parsedNetwork) else {if (input_vm_networkoptions == ‘YES’)(customOptions.parsedNetwork2)} %>”,
hasPool: false,
idName: RP25.2
},
ipMode: “”,
showNetworkPoolLabel: false,
showNetworkDhcpLabel: true
ipAddress: “<%= customOptions.vm_ipaddress %>”
}