Show Table of Contents
8.9. オーバークラウドのコンピュートノードからの仮想マシンの移行
オーバークラウドのコンピュートノードでメンテナンスを行う場合があります。ダウンタイムを防ぐには、以下の手順に従ってそのコンピュートノード上の仮想マシンを同じオーバークラウド内の別のコンピュートノードに移行します。
手順8.1 コンピュートノードの SSH キーの設定
ホストの各
nova ユーザーが移行プロセス中にアクセスできるように、全コンピュートノードには共有 SSH キーが必要です。以下の手順を使用して、各コンピュートノードで SSH キーペアを設定します。
- SSH キーを生成します。
$ ssh-keygen -t rsa -f nova_id_rsa
- 各コンピュートノード上の
novaユーザーのホームディレクトリーに、SSH キーをコピーします。 novaユーザーとして各コンピュートノードにログインして、以下のスクリプトを実行し、キーを設定します。NOVA_SSH=/var/lib/nova/.ssh mkdir ${NOVA_SSH} cp nova_id_rsa ${NOVA_SSH}/id_rsa chmod 600 ${NOVA_SSH}/id_rsa cp nova_id_rsa.pub ${NOVA_SSH}/id_rsa.pub cp nova_id_rsa.pub ${NOVA_SSH}/authorized_keys chown -R nova.nova ${NOVA_SSH} # enable login for nova user on compute hosts: usermod -s /bin/bash nova # add ssh keys of overcloud nodes into known hosts: ssh-keyscan -t rsa `os-apply-config --key hosts --type raw --key-default '' | awk '{print $1}'` >> /etc/ssh/ssh_known_hosts
手順8.2 コンピュートノードからのインスタンスの移行
- director で、
overcloudrcを読み込み、現在の nova サービスの一覧を取得します。$ source ~/stack/overcloudrc $ nova service-list
- 移行予定のノードで
nova-computeサービスを無効にします。$ nova service-disable [hostname] nova-compute
これにより、新規インスタンスはそのノード上でスケジュールされないようになります。 - ノードからインスタンスを移行するプロセスを開始します。
$ nova host-servers-migrate [hostname]
- 移行プロセスの現況は、以下のコマンドで取得できます。
$ nova migration-list
- 各インスタンスの移行が完了したら、nova の状態は
VERIFY_RESIZEに変わります。ここで、移行を正常に完了するか、環境をロールバックするかを確定する機会が提供されます。移行を確定するには、以下のコマンドを使用してください。$ nova resize-confirm [server-name]
これにより、ホストからすべてのインスタンスが移行されます。インスタンスのダウンタイムなしにホスト上のメンテナンスを実行できるようになります。ホストを有効な状態に戻すには、以下のコマンドを実行します。
$ nova service-enable [hostname] nova-compute

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.