Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

第2章 セルフホストエンジンのデプロイ

2.1. Red Hat Enterprise Linux ホストへのセルフホストエンジンのデプロイ

2.1.1. セルフホストエンジンパッケージのインストール

ホストを登録し、必要なエンタイトルメントにサブスクライブしていることを確認します。詳細は、『インストールガイドの 必要なエンタイトルメントへのサブスクライブ を参照してください。

手順2.1 セルフホストエンジンのインストール

  1. セルフホストエンジンパッケージをインストールします。
    # yum install ovirt-hosted-engine-setup
  2. Manager 用仮想マシンのインストール用の RHV-M Virtual Appliance パッケージをインストールします。
    # yum install rhevm-appliance
次の項に進むと、Red Hat Enterprise Linux ホストにセルフホストエンジンをデプロイおよび設定します。

2.1.2. RHEL ベースのセルフホストエンジンの設定

hosted-engine スクリプトは、ホストおよび Manager 用仮想マシンの設定を支援するために提供されます。スクリプトにより、一連の質問が求められ、回答に基づいて環境が設定されます。
注記
スクリプトを使用する場合は、hosted-engine --check-deployed コマンドを使用して、セルフホストエンジンがすでにデプロイされているかどうかを確認します。セルフホストエンジンがデプロイされていない場合に限りエラーが表示されます。セルフホストエンジンがすでにデプロイされている場合、その後のデプロイメントは失敗します。セルフホストエンジンを再デプロイするために、既存のデプロイのトラブルシューティングや失敗したデプロイメントをクリーンアップする必要がある場合は、3章セルフホストエンジンのデプロイメントのトラブルシューティング を参照してください。
以下の前提条件が完了していることを確認します。

前提条件

  • ovirt-hosted-engine-setup パッケージがインストールされている、新たに Red Hat Enterprise Linux 7 システムがインストールされている。
  • セルフホストエンジン環境用のストレージを準備している。少なくとも 2 つのストレージドメインが必要です。
    • Manager 用仮想マシン専用の共有ストレージドメイン。このドメインは、セルフホストエンジンのデプロイメント中に作成され、60 GB 以上である必要があります。
    • 通常の仮想マシンデータのデータストレージドメイン。このドメインは、デプロイメントの完了後にセルフホストエンジン環境に追加する必要があります。
      警告
      Red Hat は、セルフホストエンジン環境と同じデータセンターで利用可能なアクティブなデータストレージドメインを追加することを強く推奨します。
      アクティブなデータストレージドメインが 1 つしかないデータセンター内にセルフホストエンジンをデプロイし、そのデータストレージドメインが破損している場合は、新しいデータストレージドメインを追加したり、破損したデータストレージドメインを削除したりすることはできません。セルフホストエンジンを再デプロイする必要があります。
      ISO ストレージドメインを使用している場合、Red Hat は、ISO ドメインがホスト型エンジン仮想マシン内にないことを推奨します。
    デプロイメント用のストレージの準備に関する詳細は、『Administration Guide』 の Storage の章を参照してください。
    重要
    iSCSI ストレージを使用している場合は、共有ストレージドメインとデータストレージドメインに同じ iSCSI ターゲットを使用しないでください。
  • Manager とホスト用に完全修飾ドメイン名を用意している。正引き (フォワードルックアップ) と逆引き (リバースルックアップ) の記録は両方とも DNS で設定する必要があります。
  • Manager のインストールには RHV-M Virtual Appliance が必要です。rhevm-appliance パッケージを手動でインストールしていない場合は、自動的にダウンロードおよびインストールされます。
  • Manager のインストールに RHV-M Virtual Appliance を使用するには、1 つのディレクトリーは 5 GB 以上である必要があります。hosted-engine スクリプトは、まず /var/tmp にアプライアンスファイルを抽出するのに十分な領域があるかどうかを確認します。そうでない場合は、別のディレクトリーを指定したり、外部ストレージをマウントしたりできます。VDSM ユーザーおよび KVM グループには、ディレクトリーに対する読み取り、書き込み、および実行権限が必要です。

手順2.2 RHEL ベースのセルフホストエンジンの設定

  1. ホストエンジンデプロイメントの開始

    hosted-engine スクリプトを実行します。任意のタイミングでスクリプトをエスケープするには、CTRL+D キーボードの組み合わせを使用してデプロイメントを中止します。ネットワークやターミナルが中断した場合にセッションが失われないように、画面 ウィンドウマネージャーを使用してスクリプトを実行することが推奨されます。インストールされていない場合は、標準の Red Hat Enterprise Linux リポジトリーで利用可能な screen パッケージをインストールします。
    # yum install screen
    # screen
    # hosted-engine --deploy
    注記
    セッションのタイムアウトまたは接続が中断された場合には、screen -d -r を実行して hosted-engine デプロイメントセッションを復元します。
  2. ストレージの設定

    使用するストレージのタイプを選択します。
    During customization use CTRL-D to abort.
    Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:
    • NFS ストレージタイプの場合は、FQDN または IP アドレスのいずれかを使用して完全なアドレスを指定し、共有ストレージドメインのパス名を指定します。
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
    • iSCSI の場合は、iSCSI ポータルの IP アドレス、ポート、ユーザー名、およびパスワードを指定し、自動検出された一覧からターゲット名を選択します。デプロイメント時に選択できる iSCSI ターゲットは 1 つだけです。
      Please specify the iSCSI portal IP address:
      Please specify the iSCSI portal port [3260]:
      Please specify the iSCSI portal user:
      Please specify the iSCSI portal password:
      Please specify the target name (auto-detected values) [default]:
    • Gluster ストレージの場合は、FQDN または IP アドレスのいずれかを使用して完全なアドレスを指定し、共有ストレージドメインのパス名を指定します。
      重要
      レプリカ 3 Gluster ストレージのみがサポートされています。以下の設定が行われていることを確認します。
      • 3 つの Gluster サーバーの /etc/glusterfs/glusterd.vol ファイルで、rpc-auth-allow-insecureon に設定します。
        option rpc-auth-allow-insecure on
      • 次のようにボリュームを設定します。
        gluster volume set volume cluster.quorum-type auto
        gluster volume set volume network.ping-timeout 10
        gluster volume set volume auth.allow \*
        gluster volume set volume group virt
        gluster volume set volume storage.owner-uid 36
        gluster volume set volume storage.owner-gid 36
        gluster volume set volume server.allow-insecure on
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volume
    • ファイバーチャネルの場合は、ホストバスアダプターを設定して接続し、hosted-engine スクリプトは利用可能な LUN を自動的に検出します。LUN には既存のデータを含めることはできません。
      The following luns have been found on the requested target:
      [1]     3514f0c5447600351       30GiB   XtremIO XtremApp
                              status: used, paths: 2 active
      
      [2]     3514f0c5447600352       30GiB   XtremIO XtremApp
                              status: used, paths: 2 active
      
      Please select the destination LUN (1, 2) [1]:
  3. ネットワークの設定

    スクリプトは、環境の管理ブリッジとして使用する可能なネットワークインターフェイスコントローラー(NIC)を検出します。次に、ファイアウォール設定をチェックし、コンソール(SPICE または VNC)アクセス用に修正を提供します。
    Please indicate a nic to set rhvm bridge on: (eth1, eth0) [eth1]:
    iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: Yes
    Please indicate a pingable gateway IP address [X.X.X.X]:
  4. 仮想マシンの設定

    ブートデバイスタイプの disk を選択し、スクリプトは利用可能な RHV-M 仮想アプライアンスを自動的に検出します。メモリーサイズを指定します。
             Please specify the device to boot the VM from (choose disk for the oVirt engine appliance)
             (cdrom, disk, pxe) [disk]:
             Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc
    [ INFO ] Detecting available oVirt engine appliances
             The following appliance have been found on your system:
                   [1] - The oVirt Engine Appliance image (OVA)
                   [2] - Directly select an OVA file
             Please select an appliance (1, 2) [1]:
    [ INFO ] Checking OVF archive content (could take a few minutes depending on archive size)
    cloud-init が Manager 用仮想マシンの初期設定を処理するようにするには、Yes を指定します。root パスワードの設定、ネットワークの設定、ホスト名の設定、使用する engine-setup の回答ファイルの挿入、起動時に engine-setup の実行などのタスクを処理するには、cloud-init に Generate を指定します。cloud-init のより高度な機能を処理する既存の cloud-init スクリプトがある場合は、必要に応じて Existing を選択します。Manager 仮想マシンの完全修飾ドメイン名 (FQDN) を指定します。HostedEngine-VM の MAC アドレスを指定するか、無作為に生成される MAC アドレスを受け入れます。MAC アドレスを使用して、仮想マシンにオペレーティングシステムをインストールする前に、DHCP および DNS サーバーを更新できます。
    注記
    cloud-init の詳細は、を参照してください https://cloudinit.readthedocs.org/en/latest/
    Would you like to use cloud-init to customize the appliance on the first boot (Yes, No)[Yes]? Yes
    Would you like to generate on-fly a cloud-init ISO image (of no-cloud type)
    or do you have an existing one (Generate, Existing)[Generate]? Generate
    Please provide the FQDN you would like to use for the engine appliance.
    Note: This will be the FQDN of the engine VM you are now going to launch.
    It should not point to the base host or to any other existing machine.
    Engine VM FQDN: (leave it empty to skip): manager.example.com
    Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? Yes
    Automatically restart the engine VM as a monitored service after engine-setup (Yes, No)[Yes]? Yes
    Enter root password that will be used for the engine appliance (leave it empty to skip): p@ssw0rd
    Confirm appliance root password: p@ssw0rd
    The following CPU types are supported by this host:
        - model_Penryn: Intel Penryn Family
        - model_Conroe: Intel Conroe Family
    Please specify the CPU type to be used by the VM [model_Penryn]:
    Please specify the number of virtual CPUs for the VM [Defaults to appliance OVF value: 4]:
    You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]:
    How should the engine VM network be configured (DHCP, Static)[DHCP]? Static
    Please enter the IP address to be used for the engine VM: 192.168.x.x
    Please provide a comma-separated list (max3) of IP addresses of domain name servers for the engine VM
    Engine VM DNS (leave it empty to skip):
    Add lines for the appliance itself and for this host to /etc/hosts on the engine VM?
    Note: ensuring that this host could resolve the engine VM hostname is still up to you (Yes, No)[No] Yes
  5. ホストエンジンの設定

    管理ポータルで識別されるホストの名前と、管理ポータルにアクセスするための admin@internal ユーザーのパスワードを指定します。SMTP サーバーの名前と TCP ポート番号、メール通知を送信するメールアドレス、メール通知を受信するメールアドレス (複数ある場合はコンマ区切りリスト) を指定します。
    Enter engine admin password: p@ssw0rd
    Confirm engine admin password: p@ssw0rd
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]:
    Please provide the FQDN for the engine you would like to use.
              This needs to match the FQDN that you will use for the engine installation within the VM.
              Note: This will be the FQDN of the VM you are now going to create,
              it should not point to the base host or to any other existing machine.
              Engine FQDN:  []: manager.example.com
    Please provide the name of the SMTP server through which we will send notifications [localhost]:
    Please provide the TCP port number of the SMTP server [25]:
    Please provide the email address from which notifications will be sent [root@localhost]:
    Please provide a comma-separated list of email addresses which will get notifications [root@localhost]:
  6. 設定プレビュー

    次に進む前に、hosted-engine スクリプトにより、入力した設定値が表示され、これらの値に進むように確認が求められます。
  7. Manager 仮想マシンの作成

    このスクリプトは Manager 用仮想マシンを作成し、ovirt-engine サービスおよび高可用性サービスを起動し、ホストと共有ストレージドメインを Manager 用仮想マシンに接続します。
    You can now connect to the VM with the following command:
    	/usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "3042QHpX" to connect to vnc console.
    Please note that in order to use remote-viewer you need to be able to run graphical applications.
    This means that if you are using ssh you have to supply the -Y flag (enables trusted X11 forwarding).
    Otherwise you can run the command from a terminal in your preferred desktop environment.
    If you cannot run graphical applications you can connect to the graphic console from another host or connect to the serial console using the following command:
    socat UNIX-CONNECT:/var/run/ovirt-vmconsole-console/fabbea5a-1989-411f-8ed7-7abe0917fc66.sock,user=ovirt-vmconsole STDIO,raw,echo=0,escape=1
    
    If you need to reboot the VM you will need to start it manually using the command:
    hosted-engine --vm-start
    You can then set a temporary password using the command:
    hosted-engine --add-console-password
    [ INFO ] Running engine-setup on the appliance
    ...
    [ INFO ] Engine-setup successfully completed
    [ INFO ] Engine is still unreachable
    [ INFO ] Engine is still unreachable, waiting...
    [ INFO ] Engine replied: DB Up!Welcome to Health Status!
    [ INFO ] Connecting to the Engine
             Enter the name of the cluster to which you want to add the host (Default) [Default]:
    [ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes... [ INFO  ] Still waiting for VDSM host to become operational...
    [ INFO  ] The VDSM Host is now operational
    [ INFO  ] Shutting down the engine VM
    [ INFO  ] Enabling and starting HA services
    [ INFO  ] Saving hosted-engine configuration on the shared storage domain
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-2015xx.conf'
    [ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    hosted-engine デプロイメントスクリプトが正常に完了すると、Red Hat Virtualization Manager が設定され、ホストで実行されます。Manager は、Manager 仮想マシン専用のデータセンター、クラスター、ホスト、Manager 仮想マシン、および共有ストレージドメインをすでに設定しています。
    重要
    admin@internal ユーザーとしてログインし、Manager の設定を継続し、さらにリソースを追加します。通常の仮想マシンデータをホストし、Manager 用仮想マシンを表示するには、データセンターを初期化するために別のデータドメインを作成する必要があります。さまざまなストレージオプションとデータストレージドメインの追加方法については、『Administration Guide』 の Storage を参照してください。
    環境に追加ユーザーを追加できるように、Red Hat Virtualization Manager をディレクトリーサーバーにリンクします。Red Hat Virtualization は、Red Hat Directory Server (RHDS)、Red Hat Identity Management (IdM)、Active Directory などの多くのディレクトリーサーバータイプをサポートします。ovirt-engine-extension-aaa-ldap-setup インタラクティブセットアップスクリプトを使用して、ディレクトリーサーバーを環境に追加します。詳細は、『Administration Guide』 の Configuring an External LDAP Provider を参照してください。
    ovirt-hosted-engine-setup スクリプトは、障害復旧を支援するために、設定中に指定した回答もファイルに保存します。--generate-answer=<file > 引数を使用して宛先が指定されていない場合、応答ファイルは /etc/ovirt-hosted-engine/answers.conf に生成されます。
    注記
    RHV-M Virtual Appliance では、SSH パスワード認証はデフォルトでは有効になっていません。SPICE または VNC コンソールから Red Hat Virtualization Manager 仮想マシンにアクセスして、SSH パスワード認証を有効にできます。sshd サービスが実行していることを確認します。/etc/ssh/sshd_config を編集し、次の 2 つのオプションを yes に変更します。
    • PasswordAuthentication
    • PermitRootLogin
    sshd サービスを再起動して、変更を適用します。
  8. 必要なエンタイトルメントへのサブスクライブ

    Manager 用仮想マシンを必要なエンタイトルメントにサブスクライブします。詳細は、『インストールガイド の 必要なエンタイトルメントへのサブスクライブ を参照してください。