You can use vicfg-vswitch to set up vSphere distributed switches.

A distributed switch functions as a single virtual switch across all associated hosts. A distributed switch allows virtual machines to maintain a consistent network configuration as they migrate across multiple hosts. See Networking Using vSphere Distributed Switches.

Like a vSphere standard switch, each distributed switch is a network hub that virtual machines can use. A distributed switch can forward traffic internally between virtual machines or link to an external network by connecting to uplink adapters.

Each distributed switch can have one or more distributed port groups assigned to it. Distributed port groups group multiple ports under a common configuration and provide a stable anchor point for virtual machines that are connecting to labeled networks. Each distributed port group is identified by a network label, which is unique to the current data center. A VLAN ID, which restricts port group traffic to a logical Ethernet segment within the physical network, is optional.

You can create distributed switches by using the vSphere Web Client. After you have created a distributed switch, you can add hosts by using the vSphere Web Client, create distributed port groups, and edit distributed switch properties and policies with the vSphere Web Client. You can add and remove uplink ports by using vicfg-vswitch.

Important: You cannot create distributed virtual switches by using ESXCLI.

See the vSphere Networking documentation and the white paper available through the Resources link at http://www.vmware.com/go/networking for information about distributed switches and how to configure them using the vSphere Web Client.

You can add and remove distributed switch uplink ports by using vicfg-vswitch.

Important: You cannot add and remove uplink ports with ESXCLI.

After the distributed switch has been set up, you can use vicfg-vswitch to add or remove uplink ports. Specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>.

  • Add an uplink port.
    vicfg-vswitch <conn_options> --add-dvp-uplink <adapter_name> --dvp <DVPort_id> <dvswitch_name>
  • Remove an uplink port.
    vicfg-vswitch <conn_options> --del-dvp-uplink <adapter_name> --dvp <DVPort_id> <dvswitch_name>