Nested ESXi on Hyper-V の構築

4 minute read

こんにちは。 今回は Nested ESXi on Hyper-V の構築を実施してみます。
Nested Hyper-V on ESXi の記事は多くあるのですが、逆はあまりないので。。。

1. カスタマイズ ESXi インストールメディアの作成

  1. PowerCLI のインストール
    ESXi-Customizer-PS を利用するには、PowerCLI が必要になります。PowerCLI は、Powershell を利用して vSphere 環境を管理するツールです。
    PowerCLI のインストール後、OS の再起動を実施してください。
    下記のように Get-VM など Hyper-V と同じコマンドもありますので、Hyper-V ホスト以外にインストールすることをおすすめします。
PS C:\Users\Administrator> Get-Command get-vm*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-VM                                             6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMGuest                                        6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMGuestNetworkInterface                        6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMGuestRoute                                   6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHost                                         6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostAccount                                  6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostAdvancedConfiguration                    6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostAuthentication                           6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostAvailableTimeZone                        6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostDiagnosticPartition                      6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostDisk                                     6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostDiskPartition                            6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostFirewallDefaultPolicy                    6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostFirewallException                        6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostFirmware                                 6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostHba                                      6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostModule                                   6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostNetwork                                  6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostNetworkAdapter                           6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostNtpServer                                6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostPatch                                    6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostProfile                                  6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostProfileRequiredInput                     6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostRoute                                    6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostService                                  6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostSnmp                                     6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostStartPolicy                              6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostStorage                                  6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMHostSysLogServer                             6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMQuestion                                     6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMResourceConfiguration                        6.0.0.0    VMware.VimAutomation.Core
Cmdlet          Get-VMStartPolicy                                  6.0.0.0    VMware.VimAutomation.Core
  1. ESXi-Customizer-PS ツールのダウンロード Hyper-V の仮想マシンで ESXi を Neted で利用する場合、Net-Tulip というネットワークドライバーをESXi にインストールする必要があります。
    Net-Tulip をインストールした カスタム ESXi インストール ISO ファイルを作成するには、ESXi-Customizer-PS というツールを使います。最新のバージョンは Github で公開されていますので、任意のフォルダにダウンロードします。
    • ESXi-Customizer-PS GitHub Pages
      # Change directory to the root directory.
      cd C:\temp
      # Download the tools archive.
      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
      invoke-webrequest https://github.com/VFrontDe/ESXi-Customizer-PS/archive/master.zip -OutFile ESXi-Customizer-PS.zip
      # Expand the downloaded files.
      expand-archive ESXi-Customizer-PS.zip -DestinationPath . -Force
      # Change to the tools directory.
      cd .\ESXi-Customizer-PS-master\
      
  2. カスタマイズ ESXi インストール ISO の作成 ESXi-Customizer-PS を利用して、カスタマイズ ISO ファイルを作成します。
    ESXi-Customizer-PS の使い方はこちらのブログサイトに詳細説明があります。
    • ESXi-Customizer-PS
      こちらのコマンドを実行することで、今回作成したい ISO を作成できます。
      # カスタマイズ ISO の作成
      ESXi-Customizer-PS.ps1 -v55 -vft -load net-tulip
      

      -v55 というのは ESXi 5.5 バージョンを指定しています。
      -v60 の場合は、 ESXi 6.0 になりますので、利用したいバージョンを指定してください。

また、-load で net-tulip を指定することで、net-tulip をインストールした ESXi イメージになります。
コマンドを実行したカレントディレクトリに、カスタマイズした ISO ファイルが作成されます。

ESXi-Customizer-PS のヘルプを確認するにはこちらのコマンドです。

ESXi-Customizer-PS -help

2. カスタマイズした ISO ファイルから ESXi をインストール

仮想マシンを作成して、ISO から ESXi をインストールします。

1.仮想マシンの作成
仮想マシンは 第1世代で作成する必要があります。また、CSP は 4コア以上に設定する必要があります。

項目 設定値
仮想マシン世代 第1世代
CPU 4コア以上
メモリ 4GB 以上
ネットワークアダプタ レガシーネットワークアダプター


コア数が要件に満たない場合は、インストール時にエラーとなりますので気を付けてください。

2.Nested の有効化
仮想マシンを作成したら、下記コマンドを実行して CPU 仮想化を有効にします。-VMname の値は適宜修正してください。 また、つぎに、レガシーネットワークアダプターの MAC Address Spoofing を有効にします。

Set-VMProcessor -VMName esxi55 -ExposeVirtualizationExtensions $True
Set-VMNetworkAdapter -VMName esx55 -MacAddressSpoofing On

これで Nested 仮想マシンの準備は完了です。

3.ESXi のインストール
作成した仮想マシンに ESXi をインストールします。

4.ESXi-Customizer-PS で作成した ISO を仮想マシンにマウントし、仮想マシンを起動します。

5.ISO メディアで Boot した後、Tab キーを押します。

6.下記のコマンドを実行します。
ignoreHeadless=TRUE このコマンドを実行すると、ESXi のインストールが開始されます。
実行しなかった場合は、OS をインストールすることができませんので注意してください。
この Relocating modules and starting up the kernel... から画面が遷移しない状態となります。

7.OS インストールが完了後の再起動時に、再度コマンドを入れる必要があります。
OS が再起動した直後に Shift + O を押します。すると、コマンドラインを入力できるようになります。 そこで下記のコマンドを実行します。 ignireHeadless=TRUE

8.OS 起動後、ESX Shell を有効化します。

9.Alt + F1 を押し、ESX Shell に Root ユーザーでログインし、下記のコマンドを実行します。

esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless

10.コマンドを実行します。

 esxcfg-advcfg --set-kernel "TRUE" ignoreHeadless

これで再起動のたびにコマンドを実行する必要がなくなります。

11.Alt + F2 を押して、ESX のダイレクトコンソールに戻ります。

これで Nested ESXi の設定は完了です。
このあとは、必要な設定を実施して vCenter に登録して動作確認をしてみてください!

カテゴリー:

更新日時: