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 Virtualization 環境でサポートされているバージョンでなければなりません。注記既存のホストを使用する場合には、ホストをメンテナンスモードに設定して、既存の環境からホストを削除します。詳しい情報は、『管理ガイド』の「ホストの削除」を参照してください。
セルフホストエンジン環境向けにストレージを準備します。セルフホストエンジンには、Manager 用仮想マシン専用の共有ストレージドメインが必要です。このドメインはデプロイメント中に作成され、容量は少なくとも 68 GB 必要です。デプロイメント用のストレージの準備に関する詳しい情報は、『管理ガイド』の「ストレージ」の章を参照してください。
重要iSCSI ストレージを使用する場合には、共有ストレージドメインとデータストレージドメインに同じ iSCSI ターゲットは使用しないでください。
-
rhvm-appliance
パッケージをインストールして RHV-M Virtual Appliance を取得します。RHV-M Virtual Appliance は常に Manager の最新のサポート対象バージョンをベースとします。移行するには、Manager のバージョンが同じでなければならないため、現在の環境の Manager バージョンを最新のサポート対象 Y ストリームバージョンに更新するようにしてください。 -
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 ナレッジベースの記事「Configuring the amount of RAM in Red Hat Virtualization Hosted Engine」を参照してください。
セルフホスト環境の移行
セルフホストエンジンのデプロイメントの開始
注記元の環境がバージョン 3.5 以前で管理ネットワークの名前が rhevm の場合は、
hosted-engine --deploy --noansible
を実行する前に回答ファイルを修正する必要があります。詳細については、「RHV: Non-Operational Hosts after Restoring Backup or Migrating to Self-Hosted Engine」を参照してください。hosted-engine
スクリプトを実行します。CTRL
+D
のキーの組み合わせを使用してデプロイメントを中断すると、スクリプトをいつでも終了することができます。ネットワークやターミナルが切断された場合などにセッションが失われないように、screen
ウィンドウマネージャーを使用してスクリプトを実行することを推奨します。このウィンドウマネージャーがインストールされていない場合は、標準の Red Hat Enterprise Linux リポジトリーに含まれているscreen
パッケージをインストールしてください。# yum install screen
# screen
# hosted-engine --deploy --noansible
注記セッションがタイムアウトした場合や接続が中断された場合には、
screen -d -r
を実行してhosted-engine
デプロイメントセッションを復元します。ストレージの設定
使用するストレージのタイプを選択します。
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 つのみです。
注記複数の iSCSI ターゲットを指定するには、セルフホストエンジンをデプロイする前にマルチパスを有効にする必要があります。詳細については、『DM Multipath』を参照してください。Multipath Helper ツールを使用して、さまざまなオプションでマルチパスをインストールおよび設定するスクリプトを生成することもできます。
Please specify the iSCSI portal IP address: Please specify the iSCSI portal port [3260]: Please specify the iSCSI discover user: Please specify the iSCSI discover password: Please specify the iSCSI portal login user: Please specify the iSCSI portal login password: [ INFO ] Discovering iSCSI targets
Gluster ストレージタイプの場合には、完全修飾ドメイン名または IP アドレスを使用した完全なアドレスと、共有ストレージドメインのパス名を指定します。
重要サポートされるストレージは、レプリカ 3 の Gluster ストレージのみです。以下の設定を完了しておいてください。
3 つすべての Gluster サーバーの /etc/glusterfs/glusterd.vol ファイルで、
rpc-auth-allow-insecure
をon
に設定します。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]:
ネットワークの設定
このスクリプトは、環境の管理ブリッジとして使用可能なネットワークインターフェースコントローラー (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]:
仮想マシンの設定
このスクリプトにより、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 に関する詳しい情報は cloud-init のドキュメント を参照してください。
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_SandyBridge: Intel SandyBridge Family - model_Westmere: Intel Westmere Family - model_Nehalem: Intel Nehalem Family Please specify the CPU type to be used by the VM [model_Nehalem]: 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
セルフホストエンジンの設定
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]:
設定のプレビュー
先に進む前に、
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_Nehalem Please confirm installation settings (Yes, No)[Yes]:
HostedEngine-VM の作成
次にこのスクリプトは、HostedEngine-VM として設定する仮想マシンを作成し、接続情報を表示します。Host-HE1 上で
hosted-engine
スクリプトを続行するためには、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
HostedEngine-VM での SSH の有効化
RHV-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
BareMetal-Manager の無効化
BareMetal-Manager (構築済みの Red Hat Virtualization 環境の Manager) に接続して
ovirt-engine
サービスを停止し、実行されないようにします。# systemctl stop ovirt-engine.service # systemctl disable ovirt-engine.service
注記BearMetal-Manager の停止は必須ではありませんが、バックアップ作成後に環境に変更が加えられないようにするために停止することを推奨します。これは、BareMetal-Manager と HostedEngine-VM が同時に既存のリソースを管理するのを防ぐことにもなります。
DNS の更新
Red Hat Virtualization 環境の FQDN が、HostedEngine-VM の IP アドレスおよび Host-HE1 で
hosted-engine
デプロイメントスクリプトを設定する際に指定した以前の FQDN と相関するように、DNS を更新します。本手順では、FQDN は manager.example.com に設定されています。これは、移行先のホストエンジン設定では、engine に指定する FQDN は移行元の engine に設定したものと同じでなければならないためです。BareMetal-Manager のバックアップ作成
バックアップを実施する前に、管理ネットワーク (ovirtmgmt) が VM ネットワークとして設定されていることを確認します。詳細については、『管理ガイド』の「論理ネットワークの全般の設定」を参照してください。
BareMetal-Manager に接続して、
--mode=backup
、--file=FILE
、および--log=LogFILE
のパラメーターを指定してengine-backup
コマンドを実行し、バックアップモード、バックアップ用に作成および使用するバックアップファイルの名前、バックアップログを格納するために作成するログファイルの名前を指定します。# engine-backup --mode=backup --file=FILE --log=LogFILE
バックアップファイルの 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/
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.
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]:
ホストと 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.
HostedEngine-VM の終了
HostedEngine-VM を終了します。
# shutdown -h now
設定の確認
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 は高可用性であるため、必要に応じて、この仮想マシンは環境内の別のセルフホストエンジンノードに移行されます。