I've got a workflow that creates a Standard vSwitch using the built-in vCO workflow, but I need to go in and change the security policy so that all created portgroups later in the workflow get the propagated values from the vSS. What I'm getting when I run this particular block, however, is "a specified parameter is not correct". Here's, quite literally, what I'm trying to run:
var networkSystem = host.configManager.networkSystem;
var spec = new VcHostVirtualSwitchSpec() ;
spec.policy = new VcHostNetworkPolicy();
spec.policy.security = new VcHostNetworkSecurityPolicy();
spec.policy.security.allowPromiscuous = false;
spec.policy.security.macChanges = false;
spec.policy.security.forgedTransmits = false;
networkSystem.updateVirtualSwitch("vSS", spec);
the value 'host' is an VC:HostSystem attribute that gets set during the workflow process. I know I'm missing something that it needs for this to work, but I'm really not sure what that thing is.
When I run the 'Update standard virtual switch' workflow, I'm getting the same error. The values I tried passing in (with all else set to null) were for the security policy values (boolean), the host, the vSS, numPorts, and MTU. All other values were set to NULL.
Notes of interest: the vmnic for this vSS has not yet been moved over, and there are no portgroups on the vSS yet..