Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

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

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

標準 Red Hat Virtualization の既存インスタンスをセルフホストエンジン環境に移行する際には hosted-engine スクリプトを使用してこのタスクを容易化します。このスクリプトは、一連の質問を尋ね、提示された回答に基づいて環境を設定します。以下の手順では、標準の Red Hat Virtualization 環境からの Manager は、BareMetal-Manager とします。
RHV-M Virtual Appliance によって、Manager 用仮想マシンとユーザー間で必要な対話が削減され、プロセスが短縮されます。ただし、アプライアンスは標準のインストールで engine-setup を自動化できますが、移行のプロセスでは、新しい Manager 用仮想マシンに予め BareMetal-Manager のバックアップファイルを復元することができるように、engine-setup を手動で実行する必要があります。
この移行では、主に以下のような操作を実行します。
  • hosted-engine スクリプトを実行して、セルフホストエンジン用ホストに使用するホストを設定して、新規 Red Hat Virtualization の仮想マシンを作成します。
  • engine-backup ツールを使用して、engine データベースと設定ファイルをバックアップし、そのバックアップを新規 Manager 用仮想マシンにコピーして、engine-backup--mode=restore パラメーターを使用してバックアップから復元します。engine-setup を実行して、Manager 用仮想マシン設定を完了します。
  • hosted-engine スクリプトに従って設定を完了します。

前提条件

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

    注記

    既存のホストを使用する場合には、ホストをメンテナンスモードに指定して、既存の環境からホストを削除します。詳しい情報は、『管理ガイド』の「ホストの削除」を参照してください。
  • セルフホストエンジン環境向けにストレージを準備します。セルフホストエンジンには、Manager 用仮想マシン専用の共有ストレージドメインが必要です。このドメインはデプロイメント中に作成され、 容量は少なくとも 60 GB 必要です。デプロイメント用のストレージの準備に関する詳しい情報は、『管理ガイド』の「ストレージ」を参照してください。

    重要

    iSCSI ストレージを使用する場合には、共有ストレージドメインとデータストレージドメインに同じ iSCSI ターゲットは使用しないでください。
  • rhvm-appliance パッケージをインストールして RHV-M Virtual Appliance を取得します。RHV-M Virtual Appliance は常に Manager の最新のサポート対象バージョンをベースとします。移行するには、Manager のバージョンが同じ必要があるため、現在の環境の Manager バージョンを最新のサポート対象 Y ストリームバージョンに更新するようにしてください。
  • Manager のインストールに RHV-M Virtual Appliance を使用するには、1 つのディレクトリーに少なくとも 60 GB の容量が必要です。hosted-engine スクリプトは最初に、アプライアンスのファイルを抽出するために十分なスペースが /var/tmp にあるかどうかチェックします。スペースが足りない場合には、別のディレクトリーを指定するか、外部ストレージをマウントすることができます。VDSM ユーザーおよび KVM グループには、このディレクトリーでの読み取り、書き込み、実行権限を指定する必要があります。
  • 新しい Manager の完全修飾ドメイン名と、バックアップした BareMetal-Manager のドメイン名は同じでなければなりません。また、正引き (フォワードルックアップ) と逆引き (リバースルックアップ) の両方を DNS で設定する必要があります。
  • BareMetal-Manager へのアクセスが可能で、変更を加えることができる必要があります。
  • BareMetal-Manager の移行先となる仮想マシンは、BareMetal-Manager の移行元の物理マシンと同じ RAM が割り当てられている必要があります。BareMetal-Manager の移行元の物理マシンよりも RAM が少ない仮想マシンに移行する必要がある場合には、https://access.redhat.com/articles/2705841 の Red Hat ナレッジベース記事を参照してください。

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

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

    注記

    バージョン 3.5 以前の Red Hat Enterprise Virtualization からアップグレードする場合には、hosted-engine --deploy --config-append=/etc/ovirt-hosted-engine/answers.conf のコマンドを実行します。answers.conf のファイルには、OVEHOSTED_NETWORK/bridgeName=str:rhevm のパラメーターを含める必要があります。バージョン 3.5 から 3.6 以降にアップグレードして、このパラメーターが設定されていない場合には、デフォルトの管理ネットワークが機能しなくなります。
    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) を検出し、次にファイアウォールの設定をチェックして、その設定を HostedEngine-VM にコンソールで (SPICE または VNC) アクセスできるように変更するかどうかを確認します。ping 送信可能なゲートウェイの IP アドレスを ovirt-ha-agent が使用するように指定すると、HostedEngine-VM を実行するのに適したホストであるかどうかを判断しやすくなります。
    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]: 
    Please indicate a pingable gateway IP address [X.X.X.X]:
  4. 仮想マシンの設定

    このスクリプトにより、Red Hat Virtualization Manager として設定する仮想マシンが作成されます。本手順では、この仮想マシンを HostedEngine-VM と呼びます。ブートデバイスタイプに disk を選択すると、スクリプトにより利用可能な RHV-M Appliances が自動的に検出されます。アプライアンスを選択します。
             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 パスワードの設定、ネットワークやホスト名の設定などのタスクを cloud-init で処理する場合には Generate を指定します。または、cloud-init の高度な機能を活用できるように既存の cloud-init スクリプトがある場合には、Existing を選択します。次に、Manager 用仮想マシンの FQDN を指定します。この値は、BareMetal-Manager に指定したのと同じ FQDN である必要があります。

    注記

    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 no-cloud ISO image 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
    engine-setupを実行する前に、BareMetal-Manager バックアップファイルを HostedEngine-VM に復元することができるようにするには、以下の質問に No と答える必要があります。
    Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? No
    Manager のドメイン名、root パスワード、ネットワーク、ハードウェア、およびコンソールアクセスについての情報を設定します。
    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. セルフホストエンジンの設定

    Red Hat Virtualization 環境内で識別するための Host-HE1 の名前と、管理ポータルへアクセスするための 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 スクリプトは、入力された設定値を表示して、これらの値で設定を続行するかどうかを尋ねます。
    Bridge interface                 : eth1
    Engine FQDN                      : manager.example.com
    Bridge name                      : ovirtmgmt
    Host address                     : host.example.com
    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                    : 50
    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)[Yes]:
  7. HostedEngine-VM の設定

    次にこのスクリプトは、HostedEngine-VM として設定する仮想マシンを作成し、接続情報を表示します。HostedEngine-VM でバックアップファイルを復元した後には、Host-HE1 上で hosted-engine スクリプトが続行される前に、engine-setup を手動で実行する必要があります。
    [ INFO  ] Stage: Transaction setup
    ...
    [ INFO  ] Creating VM
              You can now connect to the VM with the following command:
                      /bin/remote-viewer vnc://localhost:5900
              Use temporary password "3463VnKn" 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/8f74b589-8c6f-4a32-9adf-6e615b69de07.sock,user=ovirt-vmconsole STDIO,raw,echo=0,escape=1
              Please ensure that your Guest OS is properly configured to support serial console according to your distro documentation.
              Follow http://www.ovirt.org/Serial_Console_Setup#I_need_to_access_the_console_the_old_way for more info.
              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
              Please install and setup the engine in the VM.
              You may also be interested in subscribing to "agent" RHN/Satellite channel and installing rhevm-guest-agent-common package in the VM.
            
            
              The VM has been rebooted.
              To continue please install oVirt-Engine in the VM
              (Follow http://www.ovirt.org/Quick_Start_Guide for more info).
            
              Make a selection from the options below:
              (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
              (2) Abort setup
              (3) Power off and restart the VM
              (4) Destroy VM and abort setup
            
              (1, 2, 3, 4)[1]:
    以下のコマンドで VNC プロトコルを使用して仮想マシンに接続します。FQDN は、セルフホストエンジン用ホストの完全修飾ドメイン名または IP アドレスに置き換えます。
    # /bin/remote-viewer vnc://FQDN:5900
  8. HostedEngine-VM での SSH の有効化

    RHEV-M Virtual Appliance では、デフォルトで SSH パスワード認証は有効になっていません。VNC から HostedEngine-VM に接続して SSH パスワード認証を有効にし、後で BareMetal-Manager のバックアップファイルを復元して新規 Manager を設定する際に SSH を介して仮想マシンにアクセスできるようにします。sshd サービスが実行されていることを確認します。/etc/ssh/sshd_config を編集して以下の 2 つのオプションを yes に変更します。
    [...]
    PermitRootLogin yes       
    [...]
    PasswordAuthentication yes
    sshd サービスを再起動して、変更を有効にします。
    # systemctl restart sshd.service
  9. BareMetal-Manager の無効化

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

    注記

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

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

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

    engine-backup ツールを使用して、完全なバックアップを復元します。engine-setup の実行中に BareMetal-Manager データベースを手動で設定した場合には、「セルフホストエンジン Manager の手動での復元」の手順に従って、バックアップ環境を手動で復元してください。
    • Manager のみを復元する場合は、以下を実行します。
      # engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --restore-permissions
    • Manager と Data Warehouse を復元する場合には、以下を実行します。
      # engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --provision-dwh-db --restore-permissions
    正常に終了すると、以下のような出力が表示されます。
    You should now run engine-setup.
    Done.
  14. HostedEngine-VM の設定

    復元した Manager 用仮想マシンを設定します。このプロセスにより、既存の構成設定およびデータベースの内容が特定されるので、設定を確認してください。完了すると、この設定で SSH フィンガープリントと内部認証局のハッシュが提供されます。
    # engine-setup
    [ INFO  ] Stage: Initializing
    [ INFO  ] Stage: Environment setup
    Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
    Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140304075238.log
    Version: otopi-1.1.2 (otopi-1.1.2-1.el6ev)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Yum Downloading: rhel-65-zstream/primary_db 2.8 M(70%)
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment setup
    [ INFO  ] Stage: Environment customization
             
              --== PACKAGES ==--
             
    [ INFO  ] Checking for product updates...
    [ INFO  ] No product updates found
             
              --== NETWORK CONFIGURATION ==--
             
    Setup can automatically configure the firewall on this system.
    Note: automatic configuration of the firewall may overwrite current settings.
    Do you want Setup to configure the firewall? (Yes, No) [Yes]: 
    [ INFO  ] iptables will be configured as firewall manager.
             
              --== DATABASE CONFIGURATION ==--
             
             
              --== OVIRT ENGINE CONFIGURATION ==--
             
             
              --== PKI CONFIGURATION ==--
             
             
              --== APACHE CONFIGURATION ==--
             
             
              --== SYSTEM CONFIGURATION ==--
             
             
              --== END OF CONFIGURATION ==--
             
    [ INFO  ] Stage: Setup validation
    [ INFO  ] Cleaning stale zombie tasks
             
              --== CONFIGURATION PREVIEW ==--
             
              Default SAN wipe after delete           : False
              Firewall manager                        : iptables
              Update Firewall                         : True
              Host FQDN                               : manager.example.com
              Engine database secured connection      : False
              Engine database host                    : X.X.X.X
              Engine database user name               : engine
              Engine database name                    : engine
              Engine database port                    : 5432
              Engine database host name validation    : False
              Engine installation                     : True
              PKI organization                        : example.com
              NFS mount point                         : /var/lib/exports/iso
              Configure VMConsole Proxy               : True
              Engine Host FQDN                        : manager.example.com
              Configure WebSocket Proxy               : True
             
              Please confirm installation settings (OK, Cancel) [OK]:
  15. ホストと Manager の同期

    Host-HE1 に戻り、オプション 1 を選択して hosted-engine デプロイメントスクリプトを続行します。
    (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
    スクリプトにより、内部認証局のハッシュが表示され、Host-HE1 を追加するクラスターを選択するように要求されます。
    [ INFO  ] Engine replied: DB Up!Welcome to Health Status!
    [ INFO  ] Acquiring internal CA cert from the engine
    [ INFO  ] The following CA certificate is going to be used, please immediately interrupt if not correct:
    [ INFO  ] Issuer: C=US, O=example.com, CN=manager.example.com.23240, Subject: C=US, O=example.com, CN=manager.example.com.23240, Fingerprint (SHA-1): XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    [ INFO  ] Connecting to the Engine
              Enter the name of the cluster to which you want to add the host (DB1, DB2, Default) [Default]:
    [ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes...
    [ INFO  ] The VDSM Host is now operational
    [ INFO  ] Saving hosted-engine configuration on the shared storage domain
              Please shutdown the VM allowing the system to launch it as a monitored service.
              The system will wait until the VM is down.
  16. HostedEngine-VM の終了

    HostedEngine-VM を終了します。
    # shutdown -h now
  17. 設定の確認

    Host-HE1 に戻り、HostedEngine-VM のリブートが検出されていることを確認します。
    [ INFO  ] Enabling and starting HA services
    [ INFO  ] Stage: Clean up
    [ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20160509162843.conf'
    [ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    [ INFO  ] Hosted Engine successfully set up
Red Hat Virtualization Engine がセルフホストエンジンの設定環境に移行され、Manager は (同環境で HostedEngine-VM と呼ばれる) Host-HE1 の仮想マシンで実行されるようになりました。HostedEngine-VM は高可用性であるため、必要に応じて、この仮想マシンは環境内で別のホストに移行されます。