Port groups allow you to differentiate between different kinds of traffic passing through a virtual switch. You can also use port groups as a boundary for communication or for security policy configuration. The default port groups for ESXi systems are Management Network and VM Network.

When you create a port group, you can specify a VLAN ID for it. VLANs are an important part of ESXi networking because they allow you to group traffic. For example, you could create separate network segments for VMotion, for management and for development. Using VLANS, you only need to have a separate uplink adapter for each network segment and a single virtual switch connecting to that adapter. That setup can greatly reduce the number of switches you need.

To add a virtual port group, use the following steps.

1

Define a HostPortgroupSpec. For each port group, you can specify the network policy, the VLAN ID, and the virtual switch to which the port group belongs.

2

Call HostNetworkSystem.AddPortGroup, passing in the PortGroupSpec.