I dont see any functionality surrounding portgroups or virtual switches...
Am I not looking in the right place? I'm esentially wanting to build a workflow to add a portgroup to a vswitch to every host in a cluster.
Hi Eric,
portgroups are named as VcHostPortGroup. You can edit a host's network configuration with the VcHostNetworkSystem.updateVirtualSwitch()-method.
Cheers,
joerg
so there is no workflow or action element for this, are there plans to develop this?
// ------- UpdateNetworkConfig ------- for (i=0; i<actionResult.length; i++) { var config = new VcHostNetworkConfig(); config.portgroup = System.getModule("com.vmware.onyx").array(VcHostPortGroupConfig, 1); config.portgroup[0] = new VcHostPortGroupConfig(); config.portgroup[0].changeOperation = "add"; config.portgroup[0].spec = new VcHostPortGroupSpec(); config.portgroup[0].spec.name = VLAN_Name; config.portgroup[0].spec.vlanId = VLAN_ID; config.portgroup[0].spec.vswitchName = Switch_Name; config.portgroup[0].spec.policy = new VcHostNetworkPolicy(); actionResult[i].updateNetworkConfig(config, "modify"); // HostNetworkSystem }
is the code I'm using from Onyx. Property: updateNetworkConfig not found on object: VCHostSystem is the error im getting.
Hi esarakaitis,
just build a workflow with following input parameters:
*PortGroupName (assuming this name does NOT exist)
*vSitchName (assuming this vSwitch exist on Host)
and this code:
var HPGspec = new VcHostPortGroupSpec(); HPGspec.name = PortGroupName; HPGspec.vlanId = VlanID; HPGspec.vswitchName = vSwitchName; var Policy = new VcHostNetworkPolicy(); HPGspec.policy = Policy; Host.configManager.networkSystem.addPortGroup(HPGspec);
With another Workflow you can loop over all hosts in a cluster and call this workflow for each host in loop.
The package contain both: adding a port group & iterating over cluster and add port group.
-
don't forget: award points to helpful answers
visit & http://mighty-virtualization.blogspot.com/
I tried to use this package, but I am getting an error:
Property named 'addPortGroup' not found on the object: VcManagedObjectReference
Any idea why this woul dbe? It's like Orchestrator doesn't recognize Host.configManager.networkSystem is a valid object.
-Geno
Hi Geno,
I've just reimported my package and everything works fine. It is just an example for this method. Are all Parameters set? They are all mandatory, but not set as mandatory in presentation tab.
Are there any vSwitches in your host configuration or do yo use only dvSwichtes?
Regards, Andreas
add question - Message was edited by: Andreas Diemer