linux学习记录
分类:
2011-07-04 16:28:20
VMware recommends using VirtualCenter and Virtual Infrastructure Client (VI Client) for provisioning virtual switches. For more information, see the .
For the purpose of troubleshooting or if you lack a GUI, the command line interface can be utilzed to provision virtual switches.
This article provides commands for creating and modifying the VMkernel port.
The VMkernel layer 3 TCP/IP stack handles traffic for the following ESX host services:
Note: VMware recommneds using isolated network for iSCSI.
Create a VMkernelPort on vSwitch via command line:
esxcfg-vmknic --add --ip=x.x.x.x --netmask=x.x.x.x portgroup
esxcfg-vmknic --enable portgroup
Example:
esxcfg-vswitch –l (List vSwitch)
esxcfg-vswitch –a vSwitch1 (Create vSwitch)
esxcfg-vswitch –A “ISCSI” vSwitch1 (Create port group)
esxcfg-vmknic -a -i 10.10.10.33 -n 255.255.255.0 ISCSI (Assign IP )
esxcfg-vmknic –l (ListVMkernelPort)
Note: Only 1 VMkernel port is allowed per subnet on a vSwitch.
If you are unable to set the VMkernel gateway because there are no VMkernel interfaces on the same network, see .
If you are unable to rename VMkernel port, see .
Enable VMotion on vSwitch via command line:
vmware-vim-cmd hostsvc/vmotion/vnic_set [vnic]
vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0
Disabling VMotion Port:
vmware-vim-cmd hostsvc/vmotion/vnic_unset [vnic]
vmware-vim-cmd hostsvc/vmotion/vnic_unset vmk0
Check vSwitch VMotion configuration:
vmware-vim-cmd hostsvc/vmotion/netconfig_get
The output appears similar to:
[root@esxserver root]# vmware-vim-cmd hostsvc/vmotion/netconfig_get
(vim.host.VMotionSystem.NetConfig) {
dynamicType =
candidateVnic = (vim.host.VirtualNic) [
(vim.host.VirtualNic) {
dynamicType =
device = "vmk0",
key = "key-vim.host.VirtualNic-vmk0",
portgroup = "ISCSI",
spec = (vim.host.VirtualNic.Specification) {
dynamicType =
ip = (vim.host.IpConfig) {
dynamicType =
dhcp = false,
ipAddress = "10.10.10.33",
subnetMask = "255.255.255.0",
},
mac = "00:50:56:75:a2:64",
},
port =
}
],
selectedVnic =
}
Note: If you see the following line, VMotion is enabled.