为VMwareESXi添加驱动

某些的服务器在安装ESXi时缺驱动程序,如找我在浪潮服务器NF8460M3安装时找不到硬盘或者网卡,此时须要自行添加驱动程序到ESXi的安装包中。shell

准备驱动打包工具

WMware如今使用的驱动打包工具更新为基于PowerShell的VMware.PowerCLI,老版的使用的是ESXiCustomizer可能在功能,如EFI的支持上游缺陷。如下具体步骤在 https://docs.microsoft.com/en-us/powershell/gallery/installing-psget 有具体说明。windows

在线安装

1. 安装PowerShellGet

自带此模块的列表:服务器

  • Windows 10 or newer
  • Windows Server 2016 or newer
  • Windows Management Framework (WMF) 5.0 or newer
  • PowerShell 6

我本身使用的是windows10,所以不须要从新安装。异步

2. 获取最新版本的PowerShell Gallery(PowerShell库)

> Install-PackageProvider Nuget -Force
> Exit

另外,更新的命令为ide

> Update-Module -Name PowerShellGet
> Exit

3. 安装VMware.PowerCLI

> Install-Module -Name VMware.PowerCLI

在PowerShell提示符查看是否有相应的模块:工具

> Find-Module -Name VMware.PowerCLI

离线安装

1. 准备VMware.PowerCLI

方法1:下载相应的模块到C:\PowerCLI 目录(由用户指定目录名称 )code

> Save-Module -Name VMware.PowerCLI -Path C:\PowerCLI

方法2:直接官网下载,地址https://code.vmware.com/tool/vmware-powercliip

2. 拷贝文件到模块目录

执行下面的命令查看PowerShell目录get

> $ENV:PSModulePath

把下载好的文件拷贝到上述命令结果的目录里去。
重启,在PowerShell提示符查看是否有相应的模块:it

> Find-Module -Name VMware.PowerCLI

打包驱动

打包驱动前须要准备好须要的驱动程序和脱机捆绑包VMware vSphere Hypervisor (ESXi) Offline Bundle。如下是我本身准备的驱动程序和ESXi的脱机捆绑包,并按此进行说明。

VMware vSphere Hypervisor (ESXi) Offline Bundle:
update-from-esxi6.7-6.7_update02.zip
驱动程序为:
VMW-ESX-6.7.0-lsi_mr3-7.705.09.00-offline_bundle-8586101.zip

启动PowerShell并检查

管理员启动“Windows PowerShell ”,执行

> Get-ExecutionPolicy

查看是不是“RemoteSigned”,否执行

> Set-ExecutionPolicy RemoteSigned

添加脱机捆绑包和驱动

使用 Add-ESXSoftwareDepot commandlet 同时添加 ESXi 脱机捆绑包和驱动做为库。

> Add-EsxSoftwareDepot D:\VMW-ESX-6.7.0-lsi_mr3-7.705.09.00-offline_bundle-8586101.zip D:\update-from-esxi6.7-6.7_update02.zip

验证异步驱动程序如今是否可用做软件包

> Get-EsxSoftwarePackage

其中“”为添加的第三方驱动

列出可用的映像配置文件

> Get-EsxImageProfile

添加异步驱动程序到新映像配置文件

> New-EsxImageProfile -CloneProfile ESXi-6.7.0-20181002001-standard -name VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000 -Vendor Inspur

修改新生成配置文件的权限

Set-EsxImageProfile -Name  VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000 -AcceptanceLevel CommunitySupported

在ImageProfile提示中输入:VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000

将异步驱动程序添加到新映像配置文件

Add-EsxSoftwarePackage -ImageProfile  VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000 -SoftwarePackage lsi_mr3

将映像配置文件导出为 ISO文件

Export-EsxImageProfile -ImageProfile VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000 -ExportToISO -filepath E:\VMware-VMvisor-Installer-6.7.0.update01-10302608.x86_64-Inspur_Customized-A000.iso