VMware recommends using VirtualCenter and Virtual Infrastructure Client (VI Client) for provisioning virtual switches. For more information, see the ESX Administration Guide.
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.
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>,
}