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 を自動化できますが、移行プロセス engine-setup は手動で実行して、BareMetal-Manager バックアップファイルを新しい Manager 仮想マシンで事前に復元できるようにする必要があります。
移行には、以下の主要なアクションが含まれます。
  • 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 環境のサポート対象バージョンである必要があります。
    注記
    既存のホストを使用する場合は、ホストをメンテナーンス状態にし、既存の環境から削除します。詳細は、『Administration Guide』 の Removing a Host を参照してください。
  • セルフホストエンジン環境用のストレージを準備します。セルフホストエンジンには、Manager 用仮想マシン専用の共有ストレージドメインが必要です。このドメインはデプロイメント時に作成され、60 GB 以上である必要があります。デプロイメント用のストレージの準備に関する詳細は、『Administration Guide』 の Storage の章 を参照してください。
    重要
    iSCSI ストレージを使用している場合は、共有ストレージドメインとデータストレージドメインに同じ iSCSI ターゲットを使用しないでください。
  • rhevm-appliance パッケージをインストールして、RHV-M Virtual Appliance を取得します。RHV-M Virtual Appliance は常に、サポートされている最新の Manager バージョンに基づいています。Manager のバージョンが移行で同じである必要があるため、現在の環境の Manager バージョンがサポートされている最新の Y-stream バージョンに更新されていることを確認します。
  • Manager のインストールに RHV-M Virtual Appliance を使用するには、1 つのディレクトリーが 5 GB 以上であることを確認します。hosted-engine スクリプトは、まず /var/tmp にアプライアンスファイルを抽出するのに十分な領域があるかどうかを確認します。そうでない場合は、別のディレクトリーを指定したり、外部ストレージをマウントしたりできます。VDSM ユーザーおよび KVM グループには、ディレクトリーに対する読み取り、書き込み、および実行権限が必要です。
  • 新規 Manager の完全修飾ドメイン名は、BareMetal-Manager と同じ完全修飾ドメイン名である必要があります。正引きおよび逆引きルックアップレコードの両方を DNS に設定する必要があります。
  • アクセスが必要で、BareMetal-Manager に変更を加えることができます。
  • BareMetal-Manager が移行される仮想マシンには、BareMetal-Manager の移行元の物理マシンと同じ RAM が必要です。BareMetal-Manager の移行元の物理マシンよりも RAM が少ない仮想マシンに移行する必要がある場合は、Red Hat ナレッジベースアーティクル https://access.redhat.com/articles/2705841 を参照してください。

手順4.1 セルフホスト型エンジンへの移行

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

    注記
    バージョン 3.5 以前から更新する場合は、hosted-engine --deploy --config-append=/etc/ovirt-hosted-engine/answers.conf コマンドを実行する必要があります。ファイルの answers.conf には、パラメーター OVEHOSTED_NETWORK/bridgeName=str:NORMAL が含まれる必要があります。バージョン 3.5 から 3.6 以降にアップグレードすると、このパラメーターが設定されていない限り、デフォルトの管理ネットワークが機能しなくなります。
    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)のアクセス HostedEngine-VM 用にこれを変更します。ovirt-ha-agent が使用する ping 可能なゲートウェイ IP アドレスを指定して、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. 仮想マシンの設定

    このスクリプトは、この手順では HostedEngine-VM と呼ばれる、Red Hat Virtualization Manager として設定する仮想マシンを作成します。ブートデバイスタイプの 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 を実行する前に、HostedEngine-VM で BareMetal-Manager バックアップファイルを復元できるように、以下の質問に 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 として設定される仮想マシンを作成し、接続の詳細を提供します。hosted-engine スクリプトが Host-HE1 で続行する前に、HostedEngine-VM でバックアップファイルを復元した後に 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 の有効化

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

    確立された Red Hat Virtualization 環境のマネージャーである BareMetal-Manager に接続し、ovirt-engine サービスを停止し、実行しないようにします。
    # systemctl stop ovirt-engine.service
    # systemctl disable ovirt-engine.service
    注記
    BareMetal-Manager の実行を停止することは異常ではありませんが、バックアップの作成後に環境に変更が加えられないようにすることが推奨されます。さらに、BareMetal-Manager と HostedEngine-VM が既存のリソースを同時に管理しないようにします。
  10. DNS の更新

    DNS を更新して、Red Hat Virtualization 環境の FQDN が HostedEngine-VM の IP アドレスと、Host-HE1 で hosted-engine デプロイメントスクリプトを設定する際に以前に提供された FQDN に相関するようにします。この手順では、移行した hosted-engine 設定では、エンジン用に提供された FQDN は元のエンジンのエンジン設定と同じであるため、FQDN は manager.example.com として設定されました。
  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. Registering HostedEngine-VM

    HostedEngine-VM を Red Hat Subscription Management に登録し、必要なリポジトリーを有効にします。『インストールガイドの 必要なエンタイトルメントへのサブスクライブ を参照してください。
  14. HostedEngine-VM でのバックアップファイルの復元

    engine-backup ツールを使用して、完全バックアップを復元します。engine-setup の実行中に BareMetal-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.
  15. 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]:
  16. ホストと 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.
  17. HostedEngine-VM のシャットダウン

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

    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 エンジンがセルフホストエンジンセットアップに移行されました。Manager は、環境内の HostedEngine-VM と呼ばれる Host-HE1 の仮想マシンで動作します。HostedEngine-VM は高可用性であるため、該当する場合は環境内の他のセルフホスト型エンジンノードに移行されます。