USB NICドライバを追加したESXi 8.0 のカスタムイメージを作成する

USB NICドライバを追加したESXi 8.0 のカスタムイメージを作成する

Python 3.7.9 のWindowsインストーラーをダウンロードしてインストール。
インストール時にはPATHを通すようにオプションを入れておく。
(Add python.exe to PATH)
Download Python | Python.org

このままだとPythonにsix lxml psutil pyopenssl が含まれておらず、下記のようなエラーが表示されるため
それぞれpipを使ってインストールする
pip install six lxml psutil pyopenssl

PS C:\vmware> Add-EsxSoftwareDepot .\VMware-ESXi-8.0U1a-21813344-depot.zip
Add-EsxSoftwareDepot : Failed to initialize the VMware.ImageBuilder PowerCLI module because of error: Missing Python mo
dules. Make sure the following Python modules are installed: six, lxml, psutil, pyopenssl.
Make sure that Python 3.7.1 or higher is installed and that you have set the path to the Python executable by using Set

  • PowerCLIConfiguration -PythonPath . See the PowerCLI Compatibility Matrixes for information on the Py

thon requirements.
発生場所 行:1 文字:1

  1. Add-EsxSoftwareDepot .\VMware-ESXi-8.0U1a-21813344-depot.zip
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [Add-EsxSoftwareDepot], Exception
+ FullyQualifiedErrorId : System.Exception,VMware.ImageBuilder.Commands.AddDepot
Python3.4だと pip は導入されているらしいが 導入した WindowsPython 3.11.4には入っていなかったため導入する
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
PS C:\vmware> python.exe .\get-pip.py

なかなかうまく進められずいったんPythonをアンインストールしたにもかかわらず
pipが入っていないと勘違いした。Python3.11.4でインストールされていたことを確認した。
Python3.7でないと動かないという記述も見たが3.7以降でWindows Store版でなければ問題ないくいけると思われる

ESXiのインストーラー起動画面の途中で「nvme_pcie loaded successfully activating: vmkdevmgr」 の表示のまま進まなくなった。
いろいろ調べてみるも原因わからず、ドライバ配布ページのBugを見てみると情報があった
Bugs | VMware Flings
>First, I have found the answer to the question mentioned in the title after 2 days of testing. It is a problem with the python version. When I change to python3.7.9 (or 3.7.8 is also possible), and package it again, it will be normal installed.
これを見るとPowerCLI側のバグなのかpython3.7.9以下でないと正常動作するにインストールディスクが作られない感じ

アプリ実行エイリアスPython関連のエイリアスを無効にする
PCを再起動する

Powershellを管理者で実行する
スクリプトの実行許可を与える
set-executionpolicy remotesigned
Power-Cliをインストールする
Install-Module -Name VMware.PowerCLI
VMware PowerCLI - VMware {code}

PS C:\Users\xuser> Install-Module -Name VMware.PowerCLI
続行するには NuGet プロバイダーが必要です PowerShellGet で NuGet ベースのリポジトリを操作するには、'2.8.5.201' 以降のバージョンの NuGet プロバイダーが必要です。NuGet プロバイダーは 'C:\Program Files\PackageManagement\ProviderAssemblies' または
'C:\Users\xuser\AppData\Local\PackageManagement\ProviderAssemblies' に配置する必要があります。'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force' を実行して NuGet プロバイダーをインストールすることもできます。今すぐ
PowerShellGet で NuGet プロバイダーをインストールしてインポートしますか?
[Y] はい(Y) [N] いいえ(N) [S] 中断(S) [?] ヘルプ (既定値は "Y"):

信頼されていないリポジトリ
信頼されていないリポジトリからモジュールをインストールしようとしています。このリポジトリを信頼する場合は、Set-PSReposit
ory コマンドレットを実行して、リポジトリの InstallationPolicy の値を変更してください。'PSGallery'
からモジュールをインストールしますか?
[Y] はい(Y) [A] すべて続行(A) [N] いいえ(N) [L] すべて無視(L) [S] 中断(S) [?] ヘルプ (既定値は "N"): Y

PS C:\vmware> Import-Module Vmware.ImageBuilder
警告: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a
better product. You can join using the following command:

Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true

VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to
improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As
part of the CEIP, VMware collects technical information about your organization窶冱 use of VMware products and services
on a regular basis in association with your organization窶冱 VMware license key(s). This information does not
personally identify any individual.

For more details: type "help about_ceip" to see the related help article.

To disable this warning and set your preference use the following command and restart PowerShell:
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.

PS C:\vmware> Add-ESXSoftwareDepot C:\vmware\VMware-ESXi-8.0U1a-21813344-depot.zip

Depot Url

                • -

zip:C:\vmware\VMware-ESXi-8.0U1a-21813344-depot.zip?index.xml

Community Networking Driver for ESXi のオフラインバンドルを読み込ませる
PS C:\vmware> Add-ESXSoftwareDepot C:\vmware\ESXi80U1-VMKUSB-NIC-FLING-64098092-component-21669994.zip

Depot Url

                • -

zip:C:\vmware\ESXi80U1-VMKUSB-NIC-FLING-64098092-component-21669994.zip?index.xml

ソフトウェアパッケージの確認
PS C:\vmware> Get-EsxSoftwarePackage
Name Version Vendor Creation Date

        • ------- ------ -------------

vmkusb-nic-fling 1.12-1vmw.801.0.0.64098092 VMW 2023/04/06 12...

新しいイメージプロファイルを作成する
PS C:\vmware> New-EsxImageProfile -CloneProfile ESXi-8.0U1a-21813344-standard -Name ESXi-8.0U1a-21813344-standard-with-vmkusb-nic-fling -Vendor hyte

Name Vendor Last Modified Acceptance Level

        • ------ ------------- ----------------

ESXi-8.0U1a-21813344-standa... hyte 2023/06/01 0... PartnerSupported

新しいイメージプロファイルにソフトウェアパッケージを追加
PS C:\vmware> Add-EsxSoftwarePackage -ImageProfile ESXi-8.0U1a-21813344-standard-with-vmkusb-nic-fling -SoftwarePackage vmkusb-nic-fling

Name Vendor Last Modified Acceptance Level

        • ------ ------------- ----------------

ESXi-8.0U1a-21813344-standa... hyte 2023/08/16 1... PartnerSupported

ISOイメージを作成する
PS C:\vmware> Export-EsxImageProfile -ImageProfile ESXi-8.0U1a-21813344-standard-with-vmkusb-nic-fling -ExportToIso -FilePath "VMware-VMvisor-Installer-8.0U1a-21813344.x86_64_with_vmkusb-nic-fling.iso"


通常通りインストールする

途中「Exception: No vmknic tagged for management was found.」
という表示が出てESXi 8.01.0 73% という画面で固まる

qiita.com

インストールそのもの終わっているので、再起動する
rootユーザーのパスワードは空となっている
キーボードの設定も空になっているので再設定を行う


USB NICにIPが振られないのでインターフェースを再起動する
そうするとIPが振れるようになる
ただ、再起動するたびにリセットされるので
下記の方法でUSB NICを起動時から有効化する

ESXi のSSHを有効化し、SSHでログインする

起動時USB NIC を認識させるために
/etc/rc.local.d/local.sh を編集する
ただし起動は遅くなる
[root@localhost:~] vi /etc/rc.local.d/local.sh
exit 0 の前に下記を追記する

vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{prin
count=0
while $count -lt 20 && "$[vusb0_status}" != "Up"
do
sleep 10
count=$*1
vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{
done

esxcfg-vswitch -R

flings.vmware.com



tech-wiki.pomme-verte.net
VMware PowerCLI - VMware {code}
ESXiのCustom Installer作成時のエラー対処① - インフラエンジニアなるままに
NUC Kit NUC7PJYH で ESXi 7.0 備忘録 | hyt adversaria
ESXiにUSBのNICを物理NICとして認識させる方法 - そういうのがいいブログ
【VMware ESXi】新たに購入したMINI PCでESXi8.0構築時のトラブルとカスタムISO作成のお話 - HiRoLabブログ
Celeron J4125搭載ミニPCにVMware ESXi 8.0導入 - Fun Scripting 2.0


ドライバ
USB Network Native Driver for ESXi | VMware Flings

こっちはIntelのみかつESXi8では内包されている
Community Networking Driver for ESXi | VMware Flings

実機でIntel Processor Graphicsメモリ検証 | DXR165の備忘録



USB Nic
RTL8153は何もしなくても認識するらしい
AX88179はドライバが必要
https://www.seekabypro.com/2022/08/02/pc_serv_rep2022_no_1/#USB-NIC

USB Network Native Driver for ESXi - おなかすいたWiki!

https://dlcdnets.asus.com/pub/ASUS/server/ESC500_G4_SFF/Manual/J13272_ESC500_G4_SFF_UM_V2_WEB.pdf?_ga=2.221084187.2030038820.1539060238-718616438.1535417606

https://dlsvr04.asus.com.cn/pub/ASUS/mb/socket1151/WS-C246M-PRO/Manual/J15306_WS_C246M_PRO_UM_WEB.pdf

ESXi7.0でブート時にUSB NICが外れてしまう - 蒲田ネット

*1: $count + 1