第2章 セルフホストエンジン (Self-Hosted Engine) のデプロイ

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

2.1.1. セルフホストエンジン (Self-Hosted Engine) のパッケージのインストール

ホストが必要なエンタイトルメントに登録およびサブスクライブされていることを確認します。詳しい情報は『インストールガイド』の「必要なエンタイトルメントのサブスクライブ」を参照してください。

手順2.1 セルフホストエンジン (Self-Hosted Engine) のインストール

  1. セルフホストエンジン (Self-Hosted Engine) のパッケージをインストールします。
    # yum install ovirt-hosted-engine-setup
  2. Manager 用仮想マシンのインストールにアプライアンスを使用する場合には、オプションで RHV-M Virtual Appliance パッケージをインストールします。
    # yum install rhevm-appliance
    Manager のオペレーティングシステムのインストール用に CD-ROM、ディスクまたは PXE インストールメディアのいずれかを使用することも可能です。物理 CD-ROM ドライブはサポートされません。
次のセクションに進み、Red Hat Enterprise Linux ホストにセルフホストエンジンのデプロイおよび設定を行います。

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

hosted-engine スクリプトは、ホストおよび Manager 用仮想マシンの設定を容易にするために提供されています。このスクリプトは、一連の質問を尋ね、その回答に基づいて環境を構築していきます。
以下の前提条件が満たされていることを確認してください。

前提条件

  • 新規インストールした Red Hat Enterprise Linux 7 システムに ovirt-hosted-engine-setup パッケージをインストールしておく必要があります。
  • セルフホストエンジン環境のストレージを準備する必要があります。ご使用のデプロイメントのストレージを用意する方法については、『管理ガイド』の「ストレージ」の章を参照してください。
  • Manager およびホスト用の完全修飾ドメイン名を設定しておく必要があります。正引き (フォワードルックアップ) と逆引き (リバースルックアップ) の両方を DNS で設定する必要があります。
  • Manager のオペレーティングシステムのインストール用に CD-ROM、ディスクまたは PXE インストールメディアのいずれかを用意しておく必要があります。推奨の方法は、ディスクオプションを選択して、Manager のインストールに RHV-M Virtual Appliance を使用することです。rhevm-appliance パッケージをインストールして、RHV-M Virtual Appliance を取得します。CD-ROM オプションを使用するには、ISO ファイルを用意する必要があります。物理 CD-ROM ドライブはサポートしていません。
  • Manager のインストールに RHV-M Virtual Appliance を使用するには、1 つのディレクトリーに少なくとも 60 GB の容量が必要です。hosted-engine スクリプトは最初に、アプライアンスのファイルを抽出するために十分なスペースが /var/tmp にあるかどうかチェックします。スペースが足りない場合には、別のディレクトリーを指定するか、外部ストレージをマウントすることができます。VDSM ユーザーおよび KVM グループには、このディレクトリーでの読み取り、書き込み、実行権限を指定する必要があります。

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

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

    hosted-engine スクリプトを実行します。このスクリプトを終了するには、CTRL+D のキーの組み合わせを使用して、デプロイメントを中止します。ネットワークや端末が切断された場合などにセッションが失われないように、screen ウィンドウマネージャーを使用してスクリプトを実行することを推奨します。このウィンドウマネージャーがインストールされていない場合は、標準の 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 ストレージタイプの場合には、完全修飾ドメイン名または 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 ストレージタイプの場合には、完全修飾ドメイン名または IP アドレスを使用した完全なアドレスと、共有ストレージドメインのパス名を指定します。

      重要

      サポートされるストレージは、レプリカ 3 の Gluster ストレージのみです。以下の設定が行われていることを確認してください。
      • Gluster サーバー 3 つすべての /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
    • Fiber Channel については、ホストのバスアダプターが設定、接続されている必要があります。設定/接続がされている場合には 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 Virtual Appliance が検出されます。メモリーサイズを指定してください。
             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 アドレスを使用して、仮想マシンにオペレーティングシステムをインストールする前に DCHP および 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 用の仮想マシン専用の共有ストレージドメインがすでに設定されています。

重要

Manager の設定を継続して、リソースをさらに追加するには、admin@internal ユーザーとしてログインします。通常の仮想マシンデータをホストするようにデータセンターを初期化して、Manager 用仮想マシンが見えるようにするには、別のデータドメインを作成する必要があります。ストレージの異なるオプションおよびデータストレージドメインの追加方法については、『管理ガイド』の「ストレージ」を参照してください。
Red Hat Virtualization Manager をディレクトリーサーバーにリンクして、Manager 環境に新規ユーザーを追加することができます。Red Hat Virtualization は、 Red Hat Directory Server (RHDS)、Red Hat Identity Management (IdM)、Active Directory など多くのディレクトリーサーバータイプをサポートします。ディレクトリーサーバーをお使いの環境に追加するには、ovirt-engine-extension-aaa-ldap-setup の対話型設定スクリプトを使用します。詳しい情報は、『管理ガイド』の「外部 LDAP プロバイダーの設定」を参照してください。
また、ovirt-hosted-engine-setup スクリプトにより、設定時に指定した回答がファイルに保存されます。このファイルは、障害復旧 (DR) に役立ちます。--generate-answer=<file> の引数で保存先が指定されていない場合には、応答ファイルは /etc/ovirt-hosted-engine/answers.conf に生成されます。

注記

RHEV-M Virtual Appliance では、デフォルトで SSH パスワード認証は有効になっていません。SPICE または VNC コンソールから Red Hat Virtualization Manager 用仮想マシンにアクセスして、SSH パスワード認証を有効にすることができます。sshd サービスが実行されていることを確認します。/etc/ssh/sshd_config を編集して、以下の 2 つのオプションを yes に変更します。
  • PasswordAuthentication
  • PermitRootLogin
sshd サービスを再起動して、変更を有効にします。