Esxi补丁升级
面向 ESXi 6.7 的补丁(Offline Bundle / 在线 Depot)升级操作说明。
环境
| 项目 | 说明 |
|---|---|
| 平台 | VMware ESXi 6.7 |
| 示例补丁 | ESXi670-202103001.zip(以官网实际包名为准) |
相关概念
| 概念 | 一句话 |
|---|---|
| Offline Bundle | 离线补丁包(zip),上传到数据存储后本地升级。 |
| Depot | 软件库来源,-d 可指向本地 zip 或在线 XML 地址。 |
| Profile | 一组 VIB 的集合(升级目标镜像配置),用 -p 指定。 |
| standard | 常用完整配置,一般选 *-standard。 |
| no-tools | 不含部分 Tools 相关组件,多见于 PXE 等精简场景。 |
| 维护模式 | 升级前建议进入,避免虚拟机在本主机上继续调度运行。 |
| VIB | ESXi 软件包单元;升级会新增/更新/移除相关 VIB。 |
命令参数:
-p:profile(配置文件名)-d:depot(补丁包或在线源)
一般选择以 standard 结尾 的 profile;no-tools 多用于 PXE。
1. 官网下载补丁包
打开 VMware 补丁搜索页:
https://my.vmware.com/cn/group/vmware/patch#search
按 ESXi 版本下载对应补丁包(需有权限的账号登录)。
2. 上传补丁包到主机
在主机客户端 / vSphere Client 中:
存储 → datastore1(或实际数据存储)→ 数据存储浏览器 → 上载
将 zip 上传到例如:
/vmfs/volumes/datastore1/ESXi670-202103001.zip
路径以实际上传位置为准,下文命令需同步修改。
3. SSH 升级补丁包(离线)
3.1 开启 ESXi 主机 SSH
主机 → 管理 → 服务 → SSH → 开启
3.2 确认当前版本
vmware -vl
示例:
VMware ESXi 6.7.0 build-15160138
VMware ESXi 6.7.0 Update 3
3.3 进入维护模式
esxcli system maintenanceMode set --enable true
生产环境请先迁移或关闭本机虚拟机,再进维护模式。
3.4 查询补丁包中的 Profile
esxcli software sources profile list -d /vmfs/volumes/datastore1/ESXi670-202103001.zip
示例输出:
Name Vendor Acceptance Level Creation Time Modification Time
-------------------------------- ------------ ---------------- ------------------- -------------------
ESXi-6.7.0-20210301001s-no-tools VMware, Inc. PartnerSupported 2021-03-04T10:17:40 2021-03-04T10:17:40
ESXi-6.7.0-20210304001-standard VMware, Inc. PartnerSupported 2021-03-04T10:17:40 2021-03-04T10:17:40
ESXi-6.7.0-20210301001s-standard VMware, Inc. PartnerSupported 2021-03-04T10:17:40 2021-03-04T10:17:40
ESXi-6.7.0-20210304001-no-tools VMware, Inc. PartnerSupported 2021-03-04T10:17:40 2021-03-04T10:17:40
本例选用:ESXi-6.7.0-20210304001-standard
3.5 试运行(dry-run)
查看将新增/清除哪些 VIB,以及是否有报错:
esxcli software profile update \
-p ESXi-6.7.0-20210304001-standard \
-d /vmfs/volumes/datastore1/ESXi670-202103001.zip \
--dry-run
确认无冲突、无不可接受错误后再正式升级。
3.6 正式升级
esxcli software profile update \
-p ESXi-6.7.0-20210304001-standard \
-d /vmfs/volumes/datastore1/ESXi670-202103001.zip
注意:
-d指向的是完整 zip 路径,中间不要换行断开文件名。
3.7 退出维护模式并重启
esxcli system maintenanceMode set --enable false
reboot
重启完成后再次执行 vmware -vl,确认 build / Update 级别已变化。
4. 在线升级(简述)
主机需能访问 VMware 在线 Depot,并临时放开 httpClient 防火墙规则。
esxcli system maintenanceMode set --enable true
esxcli network firewall ruleset set -e true -r httpClient
esxcli software sources profile list \
-d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml \
| grep ESXi-6.7
esxcli software profile update \
-d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml \
-p ESXi-6.7U3d-18538813-standard \
--dry-run
esxcli software profile update \
-d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml \
-p ESXi-6.7U3d-18538813-standard
esxcli network firewall ruleset set -e false -r httpClient
esxcli system maintenanceMode set --enable false
reboot
Profile 名称(如
ESXi-6.7U3d-18538813-standard)以profile list当时列出的为准;在线地址也可能随 VMware 策略变更。
流程速览
下载补丁 → 上传到 datastore
→ 开 SSH → 查版本 → 进维护模式
→ profile list → dry-run → profile update
→ 退出维护模式 → reboot → vmware -vl 验证
注意
- 升级前做好虚拟机迁移/备份与回退预案。
- 第三方驱动/定制镜像可能导致 Acceptance Level 或依赖冲突,以 dry-run 为准。
- 升级完成后建议关闭 SSH(按安全规范),并确认存储、网络、虚拟机启动正常。
- 集群环境可配合 vSphere Lifecycle / VUM 做批量管理;本文为单机
esxcli手工方式。