I’m up to section 2 on my VCDX Enterprise Administration exam review. This VCDX exam note deals specifically with Objective 2.1.K.2 (Create and modify virtual switches and virtual switch policies). You can easily create vSwitches and Portgroups using the VI Client. However, you may be in a situation (like on the Enterprise Administration Exam
) that you need to use the command line interface to create vSwitches and Portgroups. That is what this note will cover.
Notes for Objective 2.1.K.2: Create and modify virtual switches and virtual switch policies.
- List information about the pNICs on your ESX host (useful in helping to identify certain pNICs):
esxcfg-nics -l
- Create a new vswitch:
esxcfg-vswitch -a "vswitch_name"(where vswitch_name is the name of your new vswitch. Usually in the form of vSwitch#).
- Add a pNIC as an uplink to a vSwitch:
esxcfg-vswitch -L vmnic# vswitch#(where vmnic# is the chosen vmnic (pNIC) and vswitch# is the chosen vswitch).
- Remove a pNIC from a vSwitch:
esxcfg-vswitch -U vmnic# vswitch#(where vmnic# is the chosen vmnic (pNIC) and vswitch# is the chosen vswitch).
- Create a portgroup on a vswitch:
esxcfg-vswitch -A "portgroup_name" vswitch#(where portgroup_name is the name of your new portgroup and vswitch# is the chosen vswitch).
- Add a vmkernel NIC to a portgroup:
esxcfg-vmknic -a -i x.x.x.x -n x.x.x.x "portgroup_name"(where the first x.x.x.x is the IP Address and the second x.x.x.x is the subnet mask. Also where portgroup_name is the name of your new portgroup.)
- Enable a vmkernel nic:
esxcfg-vmknic -e "portgroup_name"(where portgroup_name is the name of your chosen vmkernel portgroup).
- Set the CDP properties of a vswitch:
esxcfg-vswitch -B listen|advertise|both(Choose “listen” , “advertise”, or “both” for CDP configuration).
The load-balancing options and other virtual switch policies can be configured through the VI Client. You can also configure them through the command-line (like enabling VMotion on a vmkernel port) using the unsupported Virtual Infrastructure metashell (vimsh), which is largely undocumented by VMware. A good place to start learning about vimsh is at VI-Toolkit.com.
