ESXi通过上传镜像升级包的命令行升级方法


①、在官方下载升级包,名称为“ESXi offline bundle”升级一般为zip格式。
注意:如果你的服务器是HP或其他品牌服务器,有一部分驱动会打包在升级包里(不同的品牌请去下载相应的升级包,如果是通用的镜像,则不需要)请去下载HP对应的升级包。

②、下载完成后将包上传到ESXi可见的存储上,我这里使用的ESXi本地的存储。
(注:如果有共享存储,建议上传到共享存储上,这样可以避免多次上传;如果没有则每台ESXi主机都需要上传),请记得上传目录,后面会用到。

③、在ESXI主机上打开SSH,默认SSH是关闭的。

④、将虚拟机迁移到其他主机或关机,将ESXI主机置入维护模式。如果没有其他主机,则将虚拟机关机。

⑤、通过SSH登录到ESXi主机,esxcli software vib update -d /vmfs/volumes/你存储的名字(我这里的是datestore1)/安装包名称。

⑥、升级成功后,reboot重启服务器。


但是我的升级过程出现了如下报错

DependencyError,RequirementCannotBeSatisfiedWithinTheImageProfile

执行如下命令:

esxcli software sources profile list -d /vmfs/volumes/5af94447-8594aede-872f-ac162d76681c /VMware-ESXi-6.7.0-Update1-10302608-HPE-Gen9plus-670.U1.10.3.5.12-Oct2018-depot.zip

Name Vendor Acceptance Level Creation TimeModification Time


HPE-ESXi-6.7.0-Update1-Gen9plus-670.U1.10.3.5.12 Hewlett Packard Enterprise PartnerSupported2018-10-03T03:08:30 2018-10-16T10:00:29

取上面第一列Name字段出来,然后决定把升级命令改为:

esxcli software profile update -d /vmfs/volumes/5af94447-8594aede-872f-ac162d76681c/VMware-ESXi-6.7.0-Update1-10302608-HPE-Gen9plus-670.U1.10.3.5.12-Oct2018-depot.zip -p HPE-ESXi-6.7.0-Update1-Gen9plus-670.U1.10.3.5.12

继而又遇到了如下VIB冲突报错

经过研究,发现这个是因为使用了HP自定义的ESXi ISO,解决方法很简单,删除冲突的VIB文件就行了。

[root@esxi81:~] esxcli software vib list | grep Emulex
scsi-lpfc820 8.2.4.141.55-1OEM.500.0.0.472560 Emulex VMwareCertified 2019-02-28
[root@esxi81:~] esxcli software vib list | grep Mell
net-mst 2.0.0.0-1OEM.550.0.0.472560 Mellanox PartnerSupported 2019-02-28
[root@esxi81:~] esxcli software vib remove -n scsi-lpfc820
Removal Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed:
VIBs Removed: Emulex_bootbank_scsi-lpfc820_8.2.4.141.55-1OEM.500.0.0.472560
VIBs Skipped:
[root@esxi81:~] esxcli software vib remove -n net-mst
Removal Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed:
VIBs Removed: Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560
VIBs Skipped:

删除之后,重启主机,继续执行升级命令进行升级。