VMware recommends using th VC Client for provisioning virtual switches. For more information, see the Manage Virtual Switches in the VMware Host Client
For the purpose of troubleshooting or if you lack a GUI, the command line interface can be utilized to provision virtual switches.
This article provides commands for creating and modifying the VMkernel port.
Note: VMware recommends using isolated network for iSCSI.
VMware vSphere ESXi
vim-cmd hostsvc/vmotion/vnic_set [vnic]vim-cmd hostsvc/vmotion/vnic_set vmk0
Disabling vMotion Port:
vim-cmd hostsvc/vmotion/vnic_unset [vnic]
vim-cmd hostsvc/vmotion/vnic_unset vmk0
vim-cmd hostsvc/vmotion/netconfig_get
The output appears similar to:
[root@esxserver root]# vim-cmd hostsvc/vmotion/netconfig_get
(vim.host.VMotionSystem.NetConfig) {
dynamicType = <unset>,
candidateVnic = (vim.host.VirtualNic) [
(vim.host.VirtualNic) {
dynamicType = <unset>,
device = "vmk0",
key = "key-vim.host.VirtualNic-vmk0",
portgroup = "ISCSI",
spec = (vim.host.VirtualNic.Specification) {
dynamicType = <unset>,
ip = (vim.host.IpConfig) {
dynamicType = <unset>,
dhcp = false,
ipAddress = "xx.xx.xx.xx",
subnetMask = "255.255.255.0",
},
mac = "xx:xx:xx:xx:xx:xx",
},
port = <unset>,
}
],
selectedVnic = <vim.host.VirtualNic:key-vim.host.VirtualNic-vmk0>,
}