您的位置:首页 > 理论基础 > 计算机网络

Vmware vSphere 5.0系列教程之四 vSphere网络原理及vSwitch简介

2014-11-12 15:56 489 查看
在一个物理网络拓扑中,通常都是路由器-交换机-PC机的连接,不同的服务器和PC机,通过交换机的连接而相互连通。
在VMware vSphere架构下服务器会虚拟出交换机来供ESX Host虚拟机来使用,虚拟交换机有两种,vSwitch虚拟交换机和vNetwork分布式虚拟交换机。
首先看下VMware提供的vSwitch的架构图,每个ESX Host均有一个标准vSwitch
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; height: 318px; border-top: 0px; border-right: 0px" title="wps_clip_image-23411" border="0" alt="wps_clip_image-23411" width="538" height="369" src="http://img1.51cto.com/attachment/201203/26/323260_1332751222IHDs.png" />

650) this.width=650;" style="width: 366px; height: 317px" border="0" alt="" width="416" height="317" src="http://img1.51cto.com/attachment/201203/185645352.jpg" />
一、ESXI的网络组成:
1.物理网卡 在ESXi中,物理网卡名称都叫vmnic,第一片物理网卡为vmnic0,第二片vmnic1,依此类推,如上图片所示的俩片网卡则为vmnic0和vmnic1。在安装完ESXI后,默认会添加第一片网卡vmnic0。vSphere的高级功能,必须通过多片网卡来实现。
2.虚拟交换机 vSwitch 由ESXI内核提供,为一个虚拟的交换机,用于连接不同的虚拟机及管理界面。vSwitch可由一块或多块vmnic组成,不同的vSwitch无法使用同一vmnic。默认会安装第一台虚拟交换机vSwitch0,用于主控台,虚拟机联机等功能。
3.通信端口(组) port/port group,主要用于提供Service Console,VmKernel,虚拟端口通信端口组功能
ESX的所有网络操作都是基于port/port group与vmnic,vSwitch之间。
4.NIC Team 将不同网卡集成到同个信道上,用于增加速度,failover,负载均衡以及其它功能。
650) this.width=650;" style="width: 429px; height: 357px" border="0" alt="" width="401" height="357" src="http://img1.51cto.com/attachment/201203/190724678.jpg" />
二、vSwitch配置
VMware vSphere虚拟出一个或者多个虚拟交换机vSwitch,vSwitch提供多个虚拟端口提供给虚拟机来进行联网,同时vSwitch通过VMware vSphere服务器上的物理网卡来与外部的物理网络进行连接。
在VMware vSphere Client管理esx的配置(configuration)--网络属性(Properties)中可以看到虚拟交换机的状况,如下图esx服务器中只建立一个虚拟交换机vSwitch0,在vSwitch0下有 一个Vm Network,并且有一台虚拟机连接在这个Vm Network下,另外还有一个Service Console,是这台esx的管理IP地址。
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-14759" border="0" alt="wps_clip_image-14759" height="412" src="http://img1.51cto.com/attachment/201203/26/323260_1332751224xo0g.png" />
查看vSwitch0的属性,可以看到这个vSwitch配置了120个虚拟端口。

通过编辑我们可以修改vSwitch0的端口数量,最大可以支持到4088个虚拟端口。
可以查看VM Network虚拟机端口组的属性,如下图所示
Service Console端口必须配置IP地址,第一个Service 默认名称为vswiff0,依此类推;
VMKernel通信端口同样必须配置IP地址,主要用于vMotion,连接存储设备的iSCSI或NFS以及Fault Tolerance log表项等功能。
虚拟机通信端口组(Virtual Machine)用于让ESXI的虚拟机与switch连接,可以是物理switch或vSwitch
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-22912" border="0" alt="wps_clip_image-22912" height="473" src="http://img1.51cto.com/attachment/201203/26/323260_1332751225T5q3.png" />
1. 如下图所示,之前安装ESX的IP地址设置,也可以在这里图形化界面设置。
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-18185" border="0" alt="wps_clip_image-18185" height="223" src="http://img1.51cto.com/attachment/201203/26/323260_13327512250ojA.png" />
2.在这里可以配置网卡的vMotion,VLAN ID,FT等信息
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-25060" border="0" alt="wps_clip_image-25060" height="229" src="http://img1.51cto.com/attachment/201203/26/323260_13327512261fhV.png" />
3.网卡流量限制
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-18143" border="0" alt="wps_clip_image-18143" height="185" src="http://img1.51cto.com/attachment/201203/26/323260_1332751227UvAK.png" />
4.有多块网卡的情况下可以设置网络的负载均衡
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="wps_clip_image-6015" border="0" alt="wps_clip_image-6015" height="300" src="http://img1.51cto.com/attachment/201203/26/323260_1332751228fj24.png" />
5.添加或者删除虚拟交换机所连接的物理网卡

添加的虚拟交换机有3中,一种就是前面我们提到的为虚拟机提供端口的交换机;一种是VMkernel,用来连接iSCSI和NFS存储,或者用来做vMotion;还有一种是Service Console服务控制台,用来配置IP管理esx主机。
看一下添加VMkernel的流程
1)连接类型选择VMkernel使用的vSwitch;
650) this.width=650;" style="width: 571px; height: 434px" border="0" alt="" src="http://img1.51cto.com/attachment/201204/173518346.jpg" width="546" height="423" />

2)选择要加入vSwitch0的网卡,此处由于只有一个vSwitch,因此默认为vSwitch0;
3)输入名称及VLAN ID;
650) this.width=650;" style="width: 576px; height: 415px" border="0" alt="" src="http://img1.51cto.com/attachment/201204/173339832.jpg" width="389" height="480" />
4)配置VMkernel的IP地址及网关;
650) this.width=650;" style="width: 577px; height: 426px" border="0" alt="" src="http://img1.51cto.com/attachment/201204/173339501.jpg" width="479" height="438" />
5)确认添加VMkernel配置即可。
6.除了默认的vSwitch外我们还可自己添加vSwitch,但是注意,同一块物理网卡vmnic只能配置到一个vSwitch上面。选择新建虚拟交换机使用的网卡虚拟交换机的名称及VLan ID确认配置即可,此处省略截图。完成添加之后可以看到esx服务器的网络中多了一个vswitch1的虚拟交换机。

除了标准的虚拟交换机(Standard Switches)外,VMware还有分布式交换机(Distributed Switches),分布式vSwitch可以横跨多个ESX Host。使用Distributed vSwitch后,多个ESX Host中的VM如同连接在同一vSwitch上一样,vm可以在任意ESX Host之间迁移。如下图所示,我们建立一个横跨俩个ESX Host的Distributed vSwitch。
650) this.width=650;" style="border-bottom: 0px; border-left: 0px; width: 456px; height: 313px; border-top: 0px; border-right: 0px" title="wps_clip_image-1628" border="0" alt="wps_clip_image-1628" width="490" height="449" src="http://img1.51cto.com/attachment/201203/26/323260_1332751229P0Hh.png" />
总结:理解vSphere的网络结构是后续所有高级功能的关键,vSwitch标准交换机将同一ESX HOST上的不同VM连接在一起,而Distributed vSwitch则将不同ESX HOST上的不同VM连接在同一个虚拟交换机上,使得这些VM在不同ESX HOST迁移时,就如同一直在同一vSwitch端口上一样。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: