Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

6.4. PXE を使用したゲスト の作成

このセクションでは、PXE でゲスト を作成する方法を説明します。

要件

PXE ゲストのインストールには、インストールするゲスト仮想マシンと同じサブネットで実行している PXE サーバーが必要です。これを実行する方法は、仮想マシンがネットワークに接続される方法によって異なります。PXE サーバーの設定が必要な場合は、サポートにお問い合わせください。

virt-install を使用した PXE インストール

virt-install PXE インストールには、--network=bridge:installation パラメーターの両方が必要です。ここで、installation はブリッジの名前および --pxe パラメーターです。

デフォルトでは、ネットワークが見つからない場合、ゲスト仮想マシンは別の起動可能なデバイスから起動しようとします。他の起動可能なデバイスが見つからない場合は、ゲストが一時停止します。qemu-kvm ブートパラメーター reboot-timeout を使用して、起動可能なデバイスが見つからなかった場合にゲストが起動を再試行できるようにします。以下に例を示します。
# qemu-kvm -boot reboot-timeout=1000

例6.2 virt-install を使用した完全仮想化 PXE インストール

# virt-install --hvm --connect qemu:///system \
--network=bridge:installation --pxe --graphics spice \
--name rhel6-machine --ram=756 --vcpus=4 \
--os-type=linux --os-variant=rhel6 \
--disk path=/var/lib/libvirt/images/rhel6-machine.img,size=10
上記のコマンドはテキストのみの環境で実行できないことに注意してください。完全仮想化(--hvm)ゲストは、--graphics spice パラメーターの代わりに --location および --extra-args "console=console_type" が指定された場合にのみ、テキストのみの環境にインストールできます。

手順6.2 virt-manager を使用した PXE インストール

  1. PXE を選択します。

    インストール方法として PXE を選択し、残りの手順に従って OS タイプ、メモリー、CPU、およびストレージ設定を行います。

    図6.8 インストール方法の選択

    Step 1 of 5 for creating a new virtual machine with virt-manager, with Network Boot (PXE) chosen for the method of installation.

    図6.9 インストールタイプの選択

    Step 2 of 5 for creating a new virtual machine with virt-manager, with Linux chosen as OS Type and Red Hat Enterprise Linux 6 chosen for version.

    図6.10 仮想化ハードウェアの詳細の指定

    Step 3 of 5 for creating a new virtual machine with virt-manager showing memory and CPU settings, with 1024MB of RAM and 2 CPUs selected.

    図6.11 ストレージの詳細の指定

    Step 4 of 5 for creating a new virtual machine with virt-manager, with check boxes selected next to "Enable storage for this virtual machine" and "Allocate entire disk now". 8GB is selected under the heading "Create a disk image on the computer's hard drive".
  2. インストールの開始

    インストールを開始する準備が整いました。

    図6.12 仮想マシンの詳細の最終処理

    Step 5 of 5 for creating a new virtual machine with virt-manager reads "Ready to begin installation of (guest name)" with a summary of options already chosen, and advanced options to choose from.
DHCP 要求が送信され、有効な PXE サーバーが見つかると、ゲスト仮想マシンのインストールプロセスが起動します。
インストールが完了したら、ゲストオペレーティングシステムに接続できます。詳細は、を参照してください。 「仮想マシンへの接続」