本章内容
◆ VMware 简介
◆ VMware vsphere
◆ 安装 VMware vCenter Server
◆ 管理 vmware vsphere
一: VMware 简介
VMware 成立于 1998 年, 2003 年存储厂商 EMC 以 6.35 亿美元收购了 VMware;
2015 年 10 月,戴尔宣布以 670 亿美元收购 EMC, VMware 2018 财年全年收入79.2 亿美元。
官网: https://www.vmware.com/cn.html
主要产品:
Workstation Pro: 面向 Windows 和 Linux 系统的个人虚拟化产品。
Fusion for Mac: 面向 Mac 系统的个人虚拟化产品。
ThinApp: 是一款无代理应用虚拟化解决方案。
Horizon: 用于管理虚拟桌面 (VDI)、应用和在线服务的领先平台。
Horizon Cloud: 用于托管虚拟桌面和应用的灵活云计算平台。
NSX for Horizon: 一款虚拟桌面基础架构 VDI(Virtual Desktop Infrastructure)网络连接解决方案
VMware Enterprise PKS: 面向多云企业和服务提供商的生产级 Kubernetes。
VMware vSphere Integrated Containers: 用于传统应用和容器化应用的企业级容器基础架构。
vSAN: 经过闪存优化的 vSphere 原生存储,适用于私有云和公有云。
VMware vSphere: 业界领先的服务器虚拟化平台, 作为基础平台,是任何云环境的理想之选 https://www.vmware.com/cn/products/vsphere.html。
Vmware 服务器虚拟化第一个产品叫 ESX, 后来 Vmware 在 4 版本的时候推出了ESXI,
ESXI 和 ESX 的版本最大的技术区别是内核的变化,从 4 版本开始 VMware把 ESX 及 ESXi
产品统称为 vSphere,但是 VMware 从 5 版本开始以后取消了原来的 ESX 版本,
所以现在来讲的话 vSphere 就是 ESXI,只是两种叫法而已。一般官方文档中以称呼 vSphere 为主。

VMware vCenter Server: 用于管理跨混合云的 vSphere 环境的集中式平台,
https://www.vmware.com/cn/products/vcenter-server.html。

二: VMware vsphere
2.1: 版本选择
版本选择选择: 5.0 5.5 6.5 6.7
standard
Enterprise
Enterprise plus
[图片上传失败...(image-189e6b-1592708513959)]
2.2: 发行说明
VMware vsphere 6.5:发行说明:
https://docs.vmware.com/cn/VMware-vSphere/6.5/rn/vsphere-esxi-vcenter-server-65-release-notes.html
与 vSphere 6.0 所支持的处理器相比较, vSphere 6.5 不再支持以下处理器:
Intel Xeon 51xx 系列
Intel Xeon 30xx 系列
Intel core 2 duo 6xxx 系列
Intel Xeon 32xx 系列
Intel core 2 quad 6xxx 系列
Intel Xeon 53xx 系列
Intel Xeon 72xx/73xx 系列
VMware vsphere 6.7:发行说明
https://docs.vmware.com/cn/VMware-vSphere/6.7/rn/vsphere-esxi-vcenter-server-67-release-notes.html
与 vSphere 6.5 所支持的处理器相比较, vSphere 6.7 不再支持以下处理器:
Xeon 31xx、 33xx、 34xx Lynnfield 和 Clarkdale、 35xx 和 36xx 系列
Xeon 52xx、 54xx、 55xx、 56xx 系列
Xeon 65xx 系列
Xeon 75xx 和 74xx 系列
i3/i5 Clarkdale 系列
i7-620LE 处理器系列
各 种 i3/i5/i7 Nehalem/Bloomfield/Clarksfield 、 Lynnfield 、
Clarkdale/Arrandale、 Westmere/Gulftown 系列
AMD Barcelona、 Shanghai、 Champlain、 Rana、 Istanbul、 Magny-Cours、 Lisbon
系列
Opteron 13xx、 23xx、 24xx、 41xx、 61xx、 83xx、 84xx 系列
Athlon-II-X2 Champlain、 Athlon-II-X3/X4 Rana 系列
2.3: 申请使用 vmware
需要注册账号并申请试用
2.3.1: 注册账号
https://my.vmware.com/cn/web/vmware/registration
需要到邮箱验证激活自己的帐号
2.3.2: 申请试用 VMware vSphere:
默认的帐号不能下载安装包,需要申请试用相应的产品才可以下载
2.3.3: 下载安 vmware vsphere 装程序
https://my.vmware.com/cn/group/vmware/home
https://my.vmware.com/cn/web/vmware/info/slug/datacenter_cloud_infrastructure/vmware_vsphere/6_7
试用申请通过之后就可以下载安装镜像
2.4: 开始安装 vmware esxi
官方安装文档:
https://docs.vmware.com/cn/VMware-vSphere/index.html
2.4.1: 新建宿主机
基于 vmware workstation 虚拟机运行 vmware esxi, 安装两台 esxi 服务器, IP 地址分别是 172.17.200.102/103
稍后指定操作系统:

选择对应的 vmware esxi 版本 :

指定虚拟及名称及路径:

指定磁盘文件大小:

创建完成虚拟机:

调整虚拟机内存及 CPU 虚拟化功能:

确认内存大小及 CPU VT-x 功能开启:

选择 esxi 安装镜像:

2.4.2:开始安装 esxi 节点
安装界面

2.4.2.1: 加载内核

2.4.2.2: 加载安装程序

2.4.3: 确认安装

2.4.4: 同意协议
按 F11 同意 license

2.4.5:扫描可用硬件

2.4.6: 选择硬盘并安装

2.4.7:选择键盘

2.4.8: 设置管理员密码
最少七位,且符合载密码复杂度要求

2.4.9:开始安装

2.4.10:安装过程中
image.png
2.4.11: 安装完成

2.4.12: 配置 IP 地址
将服务器配置为静态 IP 地址,当前为 DHCP 获取的 IP 地址。
2.4.12.1: 配置界面进行登录
按 F2 进行登录

2.4.12.2:登录服务器
输入安装过程中设置的管理员密码, 管理员名称为 root, 密码为安装过程中设置的密码。

2.4.12.3: 设置静态 IP

当前为通过 DHCP 获取的 IP 地址

更改服务器 IP 为静态 IP 地址

2.4.12.4: 配置 DNS


2.4.12.5:重启网络服务
安装 ESC 退出后,再按 Y 确认重启网络服务

小笔记:开启ssh密码连接
#按alt+f1切换终端
root
password
vi /etc/ssh/sshd_config
PasswordAuthentication yes #no改为yes
services.sh restart #重启服务
#有一个报错可以忽略
2.4.13:登录 web 管理界面
通过浏览器可以单独访问 web 界面进行单机管理
2.4.13.1: 使用浏览器访问 node IP 地址

2.4.13.2: 登录管理界面

2.4.13.3: web 管理界面首页

2.4.14: 通过 workstation 管理 esxi
文件--连接到服务器



连接成功状态

2.5:通过 web 界面在 esxi 创建虚拟机
登录 web 界面后,安装并验证访问虚拟机,前提是必须开启宿主机的 CPU 辅助虚拟化功能。
2.5.1:宿主机开启硬件辅助虚拟化
VMware vsphere 必须依赖宿主机开启硬件辅助虚拟化功能,即必须在宿主机的BIOS 设置中开启 Intel vt-x,如果是 AMD CPU 则是开启 AMD-V。
开启过程






2.5.2: ISO 镜像准备
ISO 文件保存在当前 esxi 节点上
2.5.2.1: 浏览数据目录

2.5.2.2:创建 ISO 目录
ISO 目录用于保存 ISO 进行
2.5.2.3: 点击创建目录

2.5.2.4:定义目录名称

2.5.2.5:准备上传 ISO 镜像

2.5.2.6: 上传本地镜像
点击上载后,选择本地镜像并上传至当前服务器

2.5.3: 创建虚拟机
通过 web 界面创建虚拟机的详细过程
2.5.3.1:开始创建虚拟机

2.5.3.2:选择类型

2.5.3.3:定义虚拟机名称与版本

2.5.3.4: 定义存储

2.5.3.5:自定义配置
虚拟机基础信息定义
2.5.3.5.1: 基础信息配置

2.5.3.5.2:选择 ISO 镜像

选择上传好的 ISO 文件,点击选择确认

选择 ISO 后的效果:

2.5.3.6: 确认完成信息

2.5.3.7:开始安装过程
打开虚拟机电源,开始系统安装


分区及安装过程略。。。。。。。。。。。
2.5.3.8: 安装完成

2.5.4:管理虚拟机
配置 IP 并测试远程登录, 在每台 esxi 宿主机分别安装一台虚拟机, IP 地址设置为 172.18.200.103/172.18.200.104
2.5.4.1: 配置静态 IP
登录到虚拟机配置静态 IP 地址

2.5.4.2: 远程连接虚拟机
通过配置好的静态 IP 地址测试是否可以远程连接
2.6: 假如没有开启硬件辅助虚拟化

三: 安装 VMware vCenter Server
安装 vmware vsphere vcenter 管理程序
3.1: 操作系统环境依赖:
必须安装在 windows server 系统且系统版本是 windows Server 2008 SP2 或更高版本,本环境以 windows server 2016 为例。
3.1.1: 不支持的操作系统:
假如操作系统不符合要求,则报错如下:

3.1.2: 内存大小不符合要求
Vmware vsphere 需要最小 8176MB 内存, 假如内存大小不符合要求,则报错如下:

3.1.3:系统环境不符合安装要求

3.2: 安装 Windows Server
安装 windows server 2016以上版本的 server系统,并将其内存设置为大于 8176MB。
https://www.microsoft.com/zh-cn/cloud-platform/windows-server-comparison , 各主要 Windoes Servcer 版本区别。
3.2.1: 新建 Windows Server 宿主机
新建一个虚拟机, 稍后选择 ISO 镜像

选择操作系统类型: 安装 windows2016

设置虚拟机名称和保存位置

设置磁盘大小

确认虚拟机信息

配置内存大小

选择 Windows Server 2016 ISO 文件

3.2.2: Windows Server 2016 安装过程
打开虚拟机并开始安装 Windows Server 2016,此过程略掉......
3.3: 安装 VMware vCenter Server
在 windows server 2016 安装 vmware vcenter server
选择 vcenter ISO 镜像

通过镜像加载安装程序

确认安装

同意版权

同意协议

选择部署类型

定义 FQDN 名称

登录账户密码设置: 密码复杂度要求 Zhang@123456

设置复杂登录密码

使用本地账户登录

使用本地数据库

确认端口

确认安装目录

客户体验计划

验证安装信息

安装过程中

安装过程需要数十分钟

安装完成

四:管理 vmware vsphere
4.1: 通过浏览器访问 vmware vsphere
4.1.1:信任证书
4.1.2:使用 HTML5 登录 web 界面

4.1.3:登录界面
登录的时候使用的账户和密码:
账户: administrator@vsphere.local
密码: Zhang@123456
4.1.4: web 界面首页

4.2:管理 vmware vsphere
4.2.1: 新建数据中心

4.2.2:定义数据中心名称
4.2.3: 添加 esxi 主机
将配置好的两台 esxi 主机 172.18.200.102/172.18.200.103 分别添加至 vcenter 进行统一管理,需要网络必须可以连接。

4.2.3.1:通过主机 IP 添加
172.18.200.103
4.2.3.2:连接用户名和密码 (ssh)
root:password
4.2.3.3:信任证书
4.2.3.4:主机摘要信息
4.2.3.5: 许可证信息
4.2.3.6: 锁定模式

4.2.3.7:定义虚拟机位置

4.2.3.8: 最终主机信息

4.2.3.9: 主机添加任务

4.2.3.10: 主机中的虚拟机信息

4.2.4: 管理已有虚拟机
4.2.4.1:确认虚拟机状态
确认已有的虚拟机是开机状态,否则请单独打开虚拟机电源

4.2.4.2:启动虚拟机控制台

4.2.4.3: 控制台登录窗口

4.2.4.4: 配置虚拟机静态 IP

4.2.4.5: 验证网络通信

4.2.4.6: 验证 web 访问
4.2.4.6.1:配置 web 服务器

4.2.4.6.2: 验证浏览器访问 web 页面

Windows server 2012 安装更新补丁:
先自动检查系统更新,然后再安装 KB2919355 补丁包,否则补丁包安装不成功
4.3: 实现虚拟机迁移
实现将虚拟机在 vmware esxi 主机之前跨主机迁移。
4.3.1: 配置 vmotion 专用网络
在各个 esxi 主机添加 vmotion 网络,即全部以下网络添加操作:
主机—配置—虚拟交换机—添加网络
添加网络

选择网络类型

选择交换机

指定端口属性
在已启用的服务勾选 vMotion 选项实现虚拟机迁移

IP 地址配置

验证最终信息

最终效果

注: 各 node 节点都要添加 vmotion 网络, IP 地址不能冲突, 例如:下图是172.18.200.104 添加的 vmotion 网络的 IP 地址

4.3.2: 执行虚拟机迁移
在 vmware esxi 主机中,选择要迁移的目标虚拟机, 选中后右键单击, 然后选择迁移

迁移类型:
由于没有使用共享存储,所以要选择更改计算资源和存储。

选择计算资源:
会验证目标主机是否符合虚拟机迁移环境要求,如下是将 172.18.200.102 的虚拟机迁移到 172.18.200.103, 但是 172.18.200.103 还没有上传过 CentOS-7-x86_64-Minimal-1810.iso 的 ISO 镜像文件,因此检查出没有该 ISO 文件并进行警告

选择目标主机存储

选择目标主机网络

选择 vmotion

最终迁移信息

迁移任务执行中

迁移任务完成

当前主机状态

验证迁移后的虚拟机网络通信是否正常
网友评论