Create and manage ESXi network

First, case studies

1, case Overview

Ensure proper communication between the base ESXi virtual machine is a network service, usually requires the use of different physical devices are connected to form a stable and efficient network services in the physical network, but in the virtual network, requires a different virtual equipment it provides services. This case focuses on another important member of the Vmware virtualization system - the network services.

Second, the case before knowledge

1, ESXi Network Overview

1) physical network

A physical network is a network between the virtual machines running on the host to communicate with each other ESXi logically connected to each other is formed. ESXi host may have multiple physical NICs, the virtual machine can create multiple virtual NICs, connect it to a virtual switch may simultaneously communicate with each other between virtual machines.

2) virtual network

A virtual network is a network between the virtual machines running on the host to communicate with each other ESXi logically connected to each other is formed. ESXi host may have multiple physical NICs, the virtual machine can create multiple virtual NICs, connect it to a virtual switch may simultaneously communicate with each other between virtual machines.

2, ESXi network component

1) physical NICs

Acronym vmnics physical NIC, as shown, the first one called vmnic0 ESXi kernel, is called the vmnic1 second block, and so on. Vmnic ESXi host can have multiple devices connected to different physical networks, such as switches, routers, iSCSI storage.
Create and manage ESXi network

2) virtual network card

Acronym vNICs virtual NIC, each VM can have multiple virtual network card for connection to a virtual switch, to ensure proper communication between each other. As shown below, you can see that each virtual machine has its own virtual network adapter.
Create and manage ESXi network

3) virtual switch

Referred to the vSwitch virtual switch, provided by ESXi core for ensuring mutual communication between the virtual machines and the management interface, and the network provided by a connection port / port group similar physical switch. Virtual switches are divided into three types: standard switch switches, distributed switch and third parties.

(1)标准交换机
标准交换机是由每台ESXi主机单独管理的简易交换机,与物理交换机非常类似,但不具备物理交换机所拥有的一些高级功能。标准交换机操作简单,但每次进行配置修改都要在所有ESXi主机上进行重复操作,增加了管理成本,并且在主机之间迁移虚拟机时,会重置网络连接状态,加大了监控和故障排除的难度。标准交换机提供了三种类型的端口/端口组。如下图:
Create and manage ESXi network

  • 虚拟机端口组,用于连接ESXi上的虚拟机,使其能够相互通信,也可以连接外部网络。如果没有接入vmnic,则只能在单台ESXi主机内部进行通信。

  • VMKernel,用于ESXi主机通过网络连接提供vSphere的高级功能。

  • NIC Team,用于将多个vmnic同时接入同一个端口/端口组,增加吞吐量,并在出现故障时可以提供链路冗余。

(2)分布式交换机
如下图所示,分布式交换机是可以对多个ESXi进行集中式管理的高级交换机,可对多个ESXi进行统一管理,包括管理成本、流量监控、流量控制、私有VLAN等高级功能。分布式交换机提供一种分布式端口/端口组。
Create and manage ESXi network
分布式端口组的成员是连接到ESXi主机的VMKernel或vNIC的一种端口,可以为每个端口指定配置,但成员端口本身也可以更改部分配置。分布式端口组还可以定义通过分布式交换连接到网络的方式。

三、案例环境

Create and manage ESXi network

四、案例分析

1、标准虚拟交换机和分布式虚拟交换机的本质区别在于其应用的范围。标准虚拟交换机只能应用于一个物理主机,不具备任何的灵活性,并且其他主机不能共享一个虚拟交换机。而分布式虚拟机可以在主机之间实现共享,并在各个主机之间作为虚拟设备实现可用性。

2、标准虚拟交换机需要每台ESXi都要配置一遍,分布式虚拟交换机只需要在vCenter里面配置一遍即可。

五、开始部署

Create and manage ESXi network

1、开启ESXi_01:

Create and manage ESXi network

2、开启ESXi_02:

Create and manage ESXi network

3、开启DC1域控制器:

Create and manage ESXi network

4、开启SQL数据库:

Create and manage ESXi network

5、开启vCenter:

Create and manage ESXi network

6、开启客户端:

Create and manage ESXi network

客户端配置IP地址
Create and manage ESXi network

连接ESXi_01服务器
Create and manage ESXi network

Win2k3虚拟机添加网卡
Create and manage ESXi network

添加网卡
Create and manage ESXi network

默认下一步
Create and manage ESXi network

添加完成
Create and manage ESXi network

开启虚拟机
Create and manage ESXi network

打开控制台
Create and manage ESXi network

配置IP地址,使虚拟网络能和管理网络通信
Create and manage ESXi network

7、vClient创建标准交换机:

开始使用vClient创建标准交换机
Create and manage ESXi network

连接类型选择虚拟机,单击下一步
Create and manage ESXi network

选择创建标准交换机,不勾选网卡,单击下一步
Create and manage ESXi network

默认下一步
Create and manage ESXi network

创建完成
Create and manage ESXi network
Create and manage ESXi network

将win2k3虚拟机连接到第二台标准交换机
Create and manage ESXi network

将第二块网卡添加第二台标准交换机
Create and manage ESXi network

这时再来查看,会看到第二台标准交换机新添加了一台新的虚拟机win2k3
Create and manage ESXi network

将第二台标准交换机移除,同样先编辑win2k3网卡,将第二块网卡调会第一台交换机
Create and manage ESXi network
Create and manage ESXi network

开始移除第二台标准交换机
Create and manage ESXi network

8、vCenter创建标准交换机:

使用第二种方式vCenter在ESXi_01服务器上创建标准交换机
Create and manage ESXi network

选择创建标准交换机,单击下一步
Create and manage ESXi network

选择新建标准交换机,单击下一步
Create and manage ESXi network

不需要适配器,默认下一步
Create and manage ESXi network

默认下一步
Create and manage ESXi network

创建完成
Create and manage ESXi network

ESXi_02服务器上创建标准交换机
Create and manage ESXi network

选择创建标准交换机,单击下一步
Create and manage ESXi network

选择新建标准交换机,单击下一步
Create and manage ESXi network

不需要适配器,默认下一步
Create and manage ESXi network

默认下一步
Create and manage ESXi network

创建完成
Create and manage ESXi network
Create and manage ESXi network

关闭win2k3虚拟机克隆一台新的出来
Create and manage ESXi network
Create and manage ESXi network

创建克隆虚拟机的名字,选择存放位置,单击下一步
Create and manage ESXi network

克隆在ESXi_01服务器上
Create and manage ESXi network

默认下一步
Create and manage ESXi network
Create and manage ESXi network

克隆完成
Create and manage ESXi network
Create and manage ESXi network

将两台虚拟机网卡同时添加到一台标准交换机中,实现虚拟机和虚拟机之间通信

编辑win2k3
Create and manage ESXi network

编辑第二块网卡添加第二台标准交换机
Create and manage ESXi network

编辑win2k301
Create and manage ESXi network

编辑第二块网卡添加第二台标准交换机
Create and manage ESXi network

从此可以看出已经成功把两台虚拟机添加到第二台标准交换机上
Create and manage ESXi network

开启两台虚拟机,修改IP地址
Create and manage ESXi network
Create and manage ESXi network

报错IP地址冲突正常现象
Create and manage ESXi network

配置IP地址,100网段是和物理网络通信,200网络是虚拟机和虚拟机之间通信
Create and manage ESXi network
Create and manage ESXi network

Win2k301:
Create and manage ESXi network

修改IP地址
Create and manage ESXi network
Create and manage ESXi network

Ping命令测试是否可以通信
Create and manage ESXi network

再克隆一台win2k302,克隆在ESXi02服务器上
Create and manage ESXi network

选择ESXi02服务器
Create and manage ESXi network

默认下一步
Create and manage ESXi network

选择自定义此虚拟机的硬件
Create and manage ESXi network

移除网络设备2
Create and manage ESXi network

克隆完成
Create and manage ESXi network

切换到ESXi02服务器打开win2k302虚拟机
Create and manage ESXi network

配置IP地址
Create and manage ESXi network

Ping命令测试是否可以和虚拟机之间通信
Create and manage ESXi network
可以看出来是ping不同的,此时就需要创建分布式交换机了

9、使用vcenter创建分布式交换机

创建分布式交换机
Create and manage ESXi network

创建分布式交换机,编辑名字,选择位置,单击下一步
Create and manage ESXi network

默认安装最高版本
Create and manage ESXi network

默认下一步
Create and manage ESXi network

创建完成
Create and manage ESXi network

分布式交换机添加主机
Create and manage ESXi network

选择添加主机,单击下一步
Create and manage ESXi network

选择添加哪些主机
Create and manage ESXi network

选择管理物理适配器,单击下一步
Create and manage ESXi network

将vmnic1添加为上行链路
Create and manage ESXi network
Create and manage ESXi network

添加上行链路完成,单击下一步
Create and manage ESXi network

默认下一步
Create and manage ESXi network

创建完成
Create and manage ESXi network

分布式交换机添加虚拟机
Create and manage ESXi network
Create and manage ESXi network
Create and manage ESXi network

添加完成之后三台虚拟机之间可以互相通信
Create and manage ESXi network

Win2k302添加一块新网卡,配置100网段IP地址和物理网络通信
Create and manage ESXi network

新网卡配置IP地址
Create and manage ESXi network

Ping命令测试是否可以和物理网络通信
Create and manage ESXi network

------ This concludes the article, thanks for reading ------

Guess you like

Origin blog.51cto.com/14156658/2442025