一、什么情况下要自定义ISO镜像
- 一般来说,对于DELL、Lenovo、HPE这类主流的服务器厂商,VMware官方vSphere ISO镜像或者官网的第三方客制镜像(由服务器厂商提供的封装镜像)都可以使用。
- 但是一些服务器厂商使用的硬件驱动,可能不包含在VMware官方镜像中,这时候就需要自定义安装镜像了。安装自定义镜像的前提是,硬件厂商提供了针对VMware vSphere平台的vib驱动。我之前遇到过华为的服务器,就需要手动添加HBA卡驱动到VMware官方镜像中,以支持其阵列卡等设备。
二、操作方式
- 获取最新vSphere OfflineBundle(ZIP文件)
• 获取硬件官方的vib for VMware vsphere,注意版本需要和vsphere版本兼容
• 安装好 powercli - 添加软件源
Add-EsxSoftwareDepot OfflineBundle "ZIP文件的完整路径"
Add-EsxSoftwareDepot "VIB驱动ZIP文件完整路径"
- 克隆Image配置文件
Get-EsxImageProfile | Select Name
New-EsxImageProfile -CloneProfile ESXi-6.5.0-20170702001-standard V -Vendor VENDORNAME -AcceptanceLevel PartnerSupported
- 向Image配置文件添加vib
• 找到非VMware提供的驱动包,或者直接找需要添加的驱动包
Get-EsxSoftwarePackage | where {$_.Vendor -ne "VMW"} | where {$_.Vendor -ne "VMW"}
• 添加驱动包到镜像配置文件中
Add-EsxSoftwarePackage -ImageProfile VENDORCustomProfile -SoftwarePackage net-i40e,lsi-mr3
- 导出Image配置文件到镜像文件
Export-EsxImageProfile -ImageProfile VENDORCustomProfile -ExportToIso -FilePath D:\Esxi_x.x_CustomImage.iso