Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1157016
  • 博文数量: 309
  • 博客积分: 6093
  • 博客等级: 准将
  • 技术积分: 3038
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-03 17:14
个人简介

linux学习记录

文章分类

全部博文(309)

文章存档

2014年(2)

2012年(37)

2011年(41)

2010年(87)

2009年(54)

2008年(88)

分类:

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:

  • VMware VMotion
  • iSCSI
  • NFS

Note: VMware recommneds using isolated network for iSCSI.

Solution

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:

  • Enable a VirtualNic to be used as the VMotion NIC.
  • Enable and Disable Vmotion via ssh conection with out virtual center
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.

阅读(1512) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~