第4章 ベアメタルの RHEL ベースのセルフホストエンジンへの移行

4.1. セルフホスト環境の移行

標準 Red Hat Enterprise Virtualization の既存インスタンスをセルフホストエンジン環境に移行する際には hosted-engine スクリプトを使用してこのタスクを容易化します。このスクリプトは、一連の質問を尋ね、提示された回答に基づいて環境を設定します。以下の手順では、標準の Red Hat Enterprise Virtualization 環境からの Manager は、BareMetal-Manager とします。
この移行では、主に以下のようなアクションを実行します。
  • hosted-engine スクリプトを実行して、セルフホストエンジンホストに使用するホストを設定して、新規 Red Hat Enterprise Virtualization の仮想マシンを作成します。
  • engine-backup ツールを使用して、エンジンデータベースと設定ファイルをバックアップし、そのバックアップを新規 Manager 仮想マシンにコピーして、engine-backup--mode=restore パラメーターを使用してリストアします。engine-setup を実行して、Manager 仮想マシン設定を完了します。
  • hosted-engine スクリプトに従って設定を完了します。

前提条件

  • ovirt-hosted-engine-setup パッケージがインストールされた新規ハイパーバイザーを用意してください。サブスクリプションやパッケージのインストールに関する詳細情報は、「2章Red Hat Enterprise Virtualization Hypervisor でのセルフホストエンジンのデプロイ」を参照してください。ホストは、現在の Red Hat Enterprise Virtualization 環境でサポートされているバージョンでなければなりません。

    注記

    既存のホストを使用する場合には、ホストをメンテナンスモードに指定して、既存の環境からホストを削除します。詳しい情報は、『管理ガイド』の「ホストの削除」を参照してください。
  • BareMetal-Manager に使用するオペレーティングシステムと同じバージョンのインストールメディアを用意してください。
  • 新しい Manager の完全修飾ドメイン名と、バックアップした BareMetal-Manager のドメイン名は同じでなければなりません。また、正引き (フォワードルックアップ) と逆引き (リバースルックアップ) の両方を DNS で設定する必要があります。
  • BareMetal-Manager へアクセスができ、変更を加えることができる必要があります。

手順4.1 セルフホスト環境の移行

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

    hosted-engine スクリプトを実行します。ネットワークや端末が切断された場合などにセッションが失われないように、screen ウィンドウマネージャーを使用してスクリプトを実行することを推奨します。このウィンドウマネージャーがインストールされていない場合は、標準の Red Hat Enterprise Linux に含まれている screen パッケージをインストールしてください。CTRL+D のキーボードの組み合わせを使用してデプロイメントを中断し、スクリプトをいつでも終了することができます。
    # 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]:
    環境で使用するストレージドメインとストレージデータセンターの名前を選択します。
    [ INFO  ] Installing on first host
    Please provide storage domain name. [hosted_storage]: 
    Local storage datacenter name is an internal name and currently will not be shown in engine's admin UI.Please enter local datacenter name [hosted_datacenter]:
  3. ネットワークの設定

    このスクリプトは、環境の管理ブリッジとして使用可能なネットワークインターフェースコントローラー (NIC) を検出し、次にファイアウォールの設定をチェックして、その設定を HostedEngine-VM にコンソールで (SPICE または VNC) アクセスできるように変更するかどうかを確認します。ping 送信可能なゲートウェイの IP アドレスを ovirt-ha-agent が使用するように指定すると、HostedEngine-VM を実行するのに適したホストであるかどうかを判断しやすくなります。
    Please indicate a nic to set rhevm bridge on: (eth1, eth0) [eth1]:
    iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: 
    Please indicate a pingable gateway IP address [X.X.X.X]:
  4. 仮想マシンの設定

    このスクリプトにより、Red Hat Enterprise Virtualization Manager (ホストエンジン) として設定される仮想マシンが作成されます。以下の手順では、この仮想マシンを HostedEngine-VM と呼びます。ブートデバイス (該当する場合)、インストールメディアのパス名、CPU タイプ、仮想 CPU の数、ディスクサイズを指定します。HostedEngine-VM の MAC アドレスを指定するか、ランダムに生成された Mac アドレスを適用します。MAC アドレスは、仮想マシンにオペレーティングシステムをインストール前に DHCP サーバーを更新するのに使用することができます。HostedEngine-VM の作成に必要なメモリーサイズとコンソールの接続タイプも指定します。
    Please specify the device to boot the VM from (cdrom, disk, pxe) [cdrom]: 
    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 minimum requirement: 2]: 
    Please specify the disk size of the VM in GB [Defaults to minimum requirement: 25]: 
    You may specify a MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]: 
    Please specify the memory size of the VM in MB [Defaults to minimum requirement: 4096]: 
    Please specify the console type you want to use to connect to the VM (vnc, spice) [vnc]:
  5. ホストエンジンの設定

    Red Hat Enterprise Virtualization 環境内で識別するための Host-HE1 の名前と、管理ポータルへアクセスするための admin@internal ユーザーのパスワードを指定します。HostedEngine-VM の FQDN を指定します。この手順では、FQDN に Manager.example.com を使用しています。最後に、SMTP サーバーの名前と TCP ポート番号、メール通知に使用するメールアドレス、通知を受信するメールアドレス (複数ある場合はコンマ区切りリスト) を指定します。

    重要

    Engine で指定した FQDN は、BareMetal-Manager に指定した FQDN と同じものでなければなりません。
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]: Host-HE1
    Enter 'admin@internal' user password that will be used for accessing the Administrator Portal: 
    Confirm 'admin@internal' user password: 
    Please provide the FQDN for the engine you want to use. This needs to match the FQDN that you will use for the engine installation within the VM: 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 スクリプトは、入力された設定値を表示して、これらの値で設定を続行するかどうかを尋ねます。
    Bridge interface                   : eth1
    Engine FQDN                        : manager.example.com
    Bridge name                        : rhevm
    SSH daemon port                    : 22
    Firewall manager                   : iptables
    Gateway address                    : X.X.X.X
    Host name for web application      : Host-HE1
    Host ID                            : 1
    Image size GB                      : 25
    Storage connection                 : storage.example.com:/hosted_engine/nfs
    Console type                       : vnc
    Memory size MB                     : 4096
    MAC address                        : 00:16:3e:77:b2:a4
    Boot type                          : pxe
    Number of CPUs                     : 2
    CPU Type                           : model_Penryn
    
    Please confirm installation settings (Yes, No)[No]:
  7. HostedEngine-VM の設定

    次にこのスクリプトは、HostedEngine-VM として設定する仮想マシンを作成し、接続情報を表示します。hosted-engine スクリプトが Host-HE1 上で続行される前に、HostedEngine-VM にオペレーティングシステムをインストールする必要があります。
    [ INFO  ] Stage: Transaction setup
    ...
    [ INFO  ] Creating VM
    You can now connect to the VM with the following command:
    	/usr/bin/remote-viewer vnc://localhost:5900
    Use temporary password "5379skAb" 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 console using the following command:
    virsh -c qemu+tls://Test/system console HostedEngine
    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
    The VM has been started.  Install the OS and shut down or reboot it.  To continue please make a selection:
             
              (1) Continue setup - VM installation is complete
              (2) Reboot the VM and restart installation
              (3) Abort setup
              (4) Destroy VM and abort setup
             
              (1, 2, 3, 4)[1]:
    以下のコマンドで VNC プロトコルを使用して仮想マシンに接続します。FQDN は、セルフホストエンジンの完全修飾ドメイン名または IP アドレスに置き換えます。
    /usr/bin/remote-viewer vnc://FQDN:5900
  8. 仮想マシンのオペレーティングシステムのインストール

    hosted-engine スクリプトで作成した仮想マシン HostedEngine-VM に接続して、Red Hat Enterprise Linux 6.7 のオペレーティングシステムをインストールします。
  9. ホストと仮想マシンの同期

    Host-HE1 に戻り、オプション 1 を選択して hosted-engine デプロイメントスクリプトを続行します。
    (1) Continue setup - VM installation is complete
  10. Manager のインストール

    HostedEngine-VM に接続して、適切な Red Hat Enterprise Virtualization Manager リポジトリーにサブスクライブします。『インストールガイド』の「必要なエンタイトルメントのサブスクライブ」を参照してください。
    インストール済みのパッケージには、すべて最新のバージョンが使用されていることを確認して、rhevm パッケージをインストールします。
    # yum update
    # yum install rhevm
  11. BareMetal-Manager の無効化

    BareMetal-Manager (構築済みの Red Hat Enterprise Virtualization 環境の Manager) に接続して engine を停止し、実行されないようにします。
    # service ovirt-engine stop
    # chkconfig ovirt-engine off

    注記

    BearMetal-Manager の停止は必須ではありませんが、バックアップ作成後に環境へ変更が加えられないようにするために停止することを推奨します。これは、BareMetal-Manager と HostedEngine-VM が同時に既存のリソースを管理するのを防ぐことにもなります。
  12. DNS の更新

    Red Hat Enterprise Virtualization 環境の FQDN が HostedEngine-VM の IP アドレスと Host-HE1 で hosted-engine デプロイメントスクリプトを設定する際に指定した以前の FQDN と相関するように DNS を更新します。本手順では、FQDN は manager.example.com に設定されています。これは、移行先のホストエンジン設定では、engine に指定した FQDN は移行の engine に設定したものと同じでなければならないためです。
  13. BareMetal-Manager のバックアップ作成

    BareMetal-Manager に接続して、--mode=backup--file=FILE--log=LogFILE のパラメーターを指定して engine-backup コマンドを実行し、バックアップモード、バックアップ用に使用および作成するバックアップファイル名、バックアップログを格納するために作成するログファイルの名前を指定します。
    # engine-backup --mode=backup --file=FILE --log=LogFILE
  14. バックアップファイルの HostedEngine-VM へのコピー

    BareMetal-Manager 上から、バックアップファイルを HostedEngine-VM にセキュアコピーします。以下の例では、[manager.example.com] が HostedEngine-VM の FQDN で、/backup/ が指定のフォルダーまたはパスです。指定のフォルダーまたはパスが存在しない場合は、HostedEngine-VM に接続して、そのフォルダーまたはパスを作成した後に BareMetal-Manager からバックアップをセキュアコピーします。
    # scp -p FILE LogFILE manager.example.com:/backup/
  15. バックアップファイルでの HostedEngine-VM の復元

    「セルフホストエンジン Manager の手動での復元」を参照してください。復元の手順の 新しい Manager へのバックアップファイルのコピー のステップは前の手順で実行しているので省略してください。engine-setup の実行後にこの手順に戻ります。
  16. ホストと Manager の同期

    Host-HE1 に戻り、オプション 1 を選択して hosted-engine デプロイメントスクリプトを続行します。
    (1) Continue setup - engine installation is complete
    [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ 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
              Please shutdown the VM allowing the system to launch it as a monitored service.
              The system will wait until the VM is down.
  17. HostedEngine-VM の終了

    HostedEngine-VM をシャットダウンします。
    # shutdown -h now
  18. 設定の確認

    Host-HE1 に戻り、HostedEngine-VM のリブートが検出されていることを確認します。
    [ INFO  ] Enabling and starting HA services
              Hosted Engine successfully set up
    [ INFO  ] Stage: Clean up
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
Red Hat Enterprise Virtualization の engine がホストエンジンの設定環境に移行されました。Manager はこの環境内で HostedEngine-VM と呼ばれる、Host-HE1 の仮想マシン上で稼働するようになりました。HostedEngine-VM は高可用性であるため、適切な場合には、環境内の別のホストに移行されます。