ステップ 4: Strategy Recommendations コレクターをセットアップする - Migration Hub Strategy の推奨事項

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

ステップ 4: Strategy Recommendations コレクターをセットアップする

このセクションでは、collector setup コマンドラインコマンドを使用して Migration Hub Strategy Recommendations アプリケーションデータコレクターを設定する方法について説明します。これらの構成はローカルに保存されます。

collector setup コマンドを使用する前に、以下の docker exec コマンドを使用してコレクターの Docker コンテナーに bash シェルセッションを作成する必要があります。

docker exec -it application-data-collector bash

collector setup コマンドは以下のコマンドをすべて連続して実行しますが、個別に実行することもできます。

  • collector setup --aws-configurations — AWS 設定をセットアップします。

  • collector setup --vcenter-configurations — vCenter 設定をセットアップします。

    注記

    vCenter の設定は、コレクターが vCenter でホストされている場合にのみ使用できます。ただし、collector setup --vcenter-configurations コマンドを使用して vCenter 設定を強制的にセットアップできます。

  • collector setup --remote-server-configurations — リモートサーバー設定をセットアップします。

  • collector setup --version-control-configurations — バージョン管理設定をセットアップします。

すべてのコレクター設定を同時にセットアップするには
  1. 次のコマンドを入力します。

    collector setup
  2. AWS 設定をセットアップする の説明に従って AWS 設定の情報を入力します。

  3. vCenter 設定をセットアップする の説明に従って、vCenter 構成の情報を入力します。

  4. リモートサーバー設定をセットアップする の説明に従って、リモートサーバー設定の情報を入力します。

  5. バージョン管理設定をセットアップする の説明に従って、バージョン管理設定の情報を入力します。

  6. リモート Windows サーバーと Linux サーバーをデータ収集用に準備します。 の指示に従って、Windows サーバと Linux サーバーをコレクターデータ収集用に準備します。

AWS 設定をセットアップする

collector setup コマンドまたは collector setup --aws-configurations コマンドを使用するときに、AWS 構成をセットアップするには。

  1. IAM 権限を設定しましたか...」という質問に、「はい」を意味する「Y」を入力します。これらのアクセス許可は、Strategy Recommendations のユーザーと役割 の手順に従って AWSMigrationHubStrategyCollector マネージドポリシーを使用してコレクターにアクセスするユーザーを作成したときに設定します。

  2. Strategy Recommendations のユーザーと役割 の手順に従って、コレクターにアクセスするために作成したユーザーがいる AWS アカウントから、アクセスキーとシークレットキーを入力します。

  3. リージョンを入力します (例: us-west-2)。ストラテジーレコメンデーションが使用するリージョンから、ニーズに合ったリージョンを選択します。これらのリージョンのリストについては、「AWS 全般のリファレンス」の「ストラテジーレコメンデーションエンドポイント」を参照してください。

  4. コレクター関連のメトリックを移行ハブ戦略サービスにアップロードしますか?」という質問に、「はい」を意味する「Y」を入力します。メトリクス情報は、AWS が適切なサポートを提供するのに役立ちます。

  5. コレクター関連ログをマイグレーションハブストラテジーサービスにアップロードしますか?」という質問に、「はい」を意味する「Y」と入力します。ログからの情報は、AWS が適切なサポートを提供するのに役立ちます。

次の例は、AWS 設定のエントリの例を含め、表示される内容を示しています。

Have you setup IAM permissions in you AWS account as per the user guide? [Y/N]: Y
Choose one of the following options for providing user credentials:
1. Long term AWS credentials
2. Temporary AWS credentials
Enter your options [1-2]: 2
AWS session token: 
AWS access key ID [None]: 
AWS secret access Key [None]: 
AWS region name [us-west-2]: 
AWS configurations are saved successfully
Upload collector related metrics to migration hub strategy service? By default collector will upload metrics. [Y/N]: Y
Upload collector related logs to migration hub strategy service? By default collector will upload logs. [Y/N]: Y
Application data collector configurations are saved successfully
Start registering application data collector
Application data collector is registered successfully.
        

vCenter 設定をセットアップする

collector setup コマンドまたは collector setup --vcenter-configurations コマンドを使用するときに vCenter 構成をセットアップするには:

  1. VMware vCenter 認証情報を使用して認証する場合は、「VMware vCenter 認証情報を使用して認証しますか?」という質問に「はい」を意味する「Y」を入力します。

    注記

    VMware vCenter 認証情報を使用して認証するには、VMware ツールがターゲットサーバーにインストールされている必要があります。

    ホスト URL を入力します。これは vCenter IP アドレスまたは URL のどちらでもかまいません。次に、VMware vCenter の ユーザー名パスワード を入力します。

  2. Windows サーバーを設定する場合は、「VMware vCenter によって管理されている Windows マシンはありますか?」という質問に「はい」を意味する「Y」を入力します。

    Windows のユーザー名パスワードを入力します。

    注記

    お使いの Windows リモートサーバーが Active Directory ドメインに属している場合、CLI を使用してリモートサーバーの設定を行う際には、ユーザ名を domain-name\username として入力する必要があります。たとえば、ドメインの名前が exampledomain で、ユーザー名が管理者の場合、CLI に入力するユーザー名は exampledomain\Administrator になります。

  3. Linux サーバーを設定する場合は、「VMware vCenter を使用する Linux のセットアップをしますか?」の質問に「はい」を意味する「Y」を入力します。

    Linux 用のユーザーネームパスワードを入力します。

  4. vCenter 以外のサーバーのリモートサーバー認証情報を設定する場合は、「Windows では NTLM を使用しLinuxでは SSH/Cert ベースを使用して vCenter 外部のサーバーの認証情報を設定しますか?」という質問に、「はい」を意味する「Y」を入力します。

  5. vCenter の外部で管理されている Windows マシンの認証情報が、vCenter Windows マシンの認証情報を構成するときに提供された認証情報と同じであれば、「vCenter のセットアップ時に使用したものと同じ Windows 認証情報を使用しますか?」という質問に「はい」を意味する「Y」を入力します。それ以外の場合は、「いいえ」を意味する「N」を入力します。

    「はい」を意味する「Y」と答えると、次の質問が表示されます。

    1. Windows サーバーとの最初の対話中に、コレクターがユーザーに代わってサーバー証明書を受け入れてローカルに保存しても問題ありませんか?」という質問に「はい」を意味する「Y」を入力します。

    2. SSH 認証を設定する場合は、「オプションを入力してください」の質問に「1」を入力します。

      SSH 認証を使用する場合は、生成されたキー認証情報を Linux サーバーにコピーする必要があります。詳細については、「Linux サーバーでのキーベース認証をセットアップする」を参照してください。

次の例は、VMware vCenter 設定の入力例を含め、表示される内容を示しています。

Your Linux remote server configurations are saved successfully.
collector setup —vcenter-configurations
Start setting up vCenter configurations for remote execution
Note: Authenticating using VMware vCenter credentials requires VMware tools to be installed on the target servers
Would you like to authenticate using VMware vCenter credentials? [Y/N]: y

NOTE: Your vSphere user must have Guest Operations privileges enabled.

Host Url for VMware vCenter: domain-name
Username for VMware vCenter: username
Password for VMware vCenter: password
Reenter password for VMware vCenter: password
Successfully stored vCenter credentials...
Do you have Windows machines managed by VMware vCenter? [Y/N]: y

NOTE: For the best experience, we recommend that you create a new Active Directory user in the Domain Admins group.

Username for Windows (Domain\User): username
Password for Windows: password
Reenter password for Windows: password
Successfully stored windows credentials...
You can verify your setup for vCenter windows machines is correct with "collector diag-check"
Do you have Linux machines managed by VMWare vCenter? [Y/N]: y
Username for Linux: username
Password for Linux: password
Reenter password for Linux: password
Successfully stored linux credentials...
You can verify your setup for vCenter linux machines is correct with "collector diag-check"
Would you like to setup credentials for servers not managed by vCenter using NTLM for windows and SSH/Cert based for Linux? [Y/N]: y
Setting up target server for remote execution:
Would you like to setup credentials for servers not managed by vCenter using NLTM for Windows [Y/N]: y
Would you like to use the same Windows credentials used during vCenter setup? [Y/N]: y
Are you okay with collector accepting and locally storing server certificates on your behalf during first interaction with windows servers? These certificates will be used by collector for secure communication with windows servers [Y/N]: y
Successfully stored windows server credentials...
Please note that all windows server certificates are stored in directory /opt/amazon/application-data-collector/remote-auth/windows/certs

Please note the IP address of the collector and run the script specified in the user documentation on all the windows servers in your inventory
You can verify your setup for remote windows machines is correct with "collector diag-check"
Would you like to setup credentials for servers not managed by vCenter using SSH/Cert based for Linux? [Y/N]: y
Choose one of the following options for remote authentication:
1. SSH based authentication
2. Certificate based authentication
Enter your options [1-2]: 1
Would you like to use the same Linux credentials used during vCenter setup? [Y/N]: y
Generating SSH key on this machine...
Successfully generated SSH key pair

SSH key pair path: /opt/amazon/application-data-collector/remote-auth/linux/keys/id_rsa_assessment
Please add the public key "id_rsa_assessment.pub" to the "$HOME/.ssh/authorized_keys" file in your remote machines.
You can verify your setup for remote linux machines is correct with "collector diag-check              

リモートサーバー設定をセットアップする

collector setup コマンドまたは collector setup --remote-server-configurations コマンドを使用するときにリモートサーバー設定をセットアップするには:

  1. Windows サーバーを設定する場合は、「Windows 用 NLTM を使用して vCenter で管理されていないサーバーの認証情報をセットアップしますか?」という質問に「はい」を意味する「Y」を入力します。

    WinRM 用の[ユーザーネーム][パスワード] を入力します。

    注記

    お使いの Windows リモートサーバーが Active Directory ドメインに属している場合、CLI を使用してリモートサーバーの設定を行う際には、ユーザ名を domain-name\username として入力する必要があります。たとえば、ドメインの名前が exampledomain で、ユーザー名が管理者の場合、CLI に入力するユーザー名は exampledomain\Administrator になります。

    Windows サーバーとの最初の対話中に、コレクターがユーザーに代わってサーバー証明書を受け入れてローカルに保存しても問題ありませんか?」という質問に「はい」を意味する「Y」を入力します。Windows サーバー証明書はディレクトリ /opt/amazon/application-data-collector/remote-auth/windows/certs に保存されます。

    生成されたサーバー認証情報を Windows サーバーにコピーする必要があります。詳細については、「Windows サーバーでリモートサーバー構成をセットアップする」を参照してください。

  2. Linux サーバーを設定する場合は、「SSH または Cert を使用する Linux のセットアップをしますか?」の質問に、「はい」を意味する「Y」と入力します。

  3. SSH キーベースの認証を設定する場合は、「オプションを入力してください」の質問に「1」を入力します。

    SSH 認証を使用する場合は、生成されたキー認証情報を Linux サーバーにコピーする必要があります。詳細については、「Linux サーバーでのキーベース認証をセットアップする」を参照してください。

  4. 証明書ベースの認証を設定する場合は、「オプションを入力してください」の質問に「2」を入力します。

    証明書ベースの認証の設定に関する詳細については、「Linux サーバーでの証明書ベースの認証をセットアップする」を参照してください。

次の例は、リモートサーバー設定の入力例を含め、表示される内容を示しています。

Setting up target server for remote execution
Would you like to setup credentials for servers not managed by vCenter using NLTM for Windows [Y/N]: y

NOTE: For the best experience, we recommend that you create a new Active Directory user in the Domain Admins group.

Username for WinRM (Domain\User): username
Password for WinRM: password
Reenter password for WinRM: password
Are you okay with collector accepting and locally storing server certificates on your behalf during first interaction with windows servers? These certificates will be used by collector for secure communication with windows servers [Y/N]: Y
Successfully stored windows server credentials...
Please note that all windows server certificates are stored in directory /opt/amazon/application-data-collector/remote-auth/windows/certs

Please note the IP address of the collector and run the script specified in the user documentation on all the windows servers in your inventory
Would you like to setup credentials for servers not managed by vCenter using SSH/Cert based for Linux? [Y/N]: Y
Choose one of the following options for remote authentication:
1. SSH based authentication
2. Certificate based authentication
Enter your options [1-2]: 1 
User name for remote server: username
Generating SSH key on this machine...
SSH key pair path: /opt/amazon/application-data-collector/remote-auth/linux/keys/id_rsa_assessment
Please add the public key "id_rsa_assessment.pub" to the "$HOME/.ssh/authorized_keys" file in your remote machines.
Your Linux remote server configurations are saved successfully.               

バージョン管理設定をセットアップする

collector setup コマンドまたは collector setup --version-control-configurations コマンドを使用するときにバージョンコントロール設定をセットアップするには:

  1. ソースコード分析のセットアップをしますか?」という質問に、「はい」を意味する「Y」を入力します。

  2. Git サーバーのエンドポイントを設定する場合は、「オプションを入力してください」の質問に「1」を入力します。

    GIT サーバーエンドポイントとして,github.com と入力します。

  3. GitHub Enterprise Server を設定したいなら、「オプションを入力してください」の質問に「2」を入力します。

    次のように、https:// を付けずにエンタープライズ エンドポイントを入力します。GIT サーバー エンドポイント: git-enterprise-endpoint

  4. Git ユーザー名と個人アクセストークンを入力します

  5. Windows マシンで分析すべき csharp リポジトリはありますか?」という質問に C#コードを分析する場合、「はい」を意味する「Y」を入力します。

    注記

    Porting Assistant for .NET に関するレコメンデーションの .NET リポジトリを分析するには、Porting Assistant for .NET 移植評価ツールがセットアップされた Windows マシンを用意する必要があります。詳細については、「Porting Assistant for .NET ユーザーガイド」の「Porting Assistant for .NET を開始する」を参照してください。

  6. このマシンで既存の Windows 認証情報を再利用しますか?」といつ質問の場合。C# ソースコード分析用の Windows マシンが、--remote-server-configurations または --vcenter-configurations のセットアップ時に以前に提供した認証情報と同じ認証情報を使用している場合は、「はい」を意味する「Y」を入力します。

    新しい認証情報を入力する場合は、「いいえ」の場合は「N」を入力します。

  7. VMware vCenter Windows マシンの認証情報を使用するには、Windows 認証情報の次のオプションのいずれかを選択してください に 「1」を入力します。

  8. Windows マシンの IP アドレスを入力します。

次の例は、バージョン制御設定のエントリの例を含め、表示される内容を示しています。

Set up for source code analysis [Y/N]: y
Choose one of the following options for version control type:
1. GIT
2. GIT Enterprise
3. Azure DevOps - Git
Enter your options [1-3]: 3
Your server endpoint: dev.azure.com (http://dev.azure.com/)
Your DevOps Organization name: <Your organization name>
Personal access token [None]:
Your version control credentials are saved successfully.
Do you have any csharp repositories that should be analyzed on a windows machine? [Y/N]: y
Would you like to reuse existing windows credentials on this machine? [Y/N]: y
Choose one of the following options for windows credentials:
1. VMWare vCenter Windows Machine
2. Standard Windows Machine
Enter your options [1-2]: 
1
Windows machine IP Address: <Your windows machine IP address>
Using VMWare vCenter Windows Machine credentials
Successfully stored windows server credentials...        

リモート Windows サーバーと Linux サーバーをデータ収集用に準備します。

注記

vCenter 認証情報を使用して Strategy Recommendations アプリケーションデータコレクターを設定する場合、この手順は必要ありません。

リモートサーバーの設定後、collector setup command または collector setup --remote-server-configurations コマンドを使用している場合は、Strategy Recommendations アプリケーションのデータコレクターがリモートサーバーからデータを収集できるようにリモートサーバーを準備する必要があります。

注記

プライベート IP アドレスを使用してサーバーにアクセスできることを確認する必要があります。リモート実行用に AWS の仮想プライベートクラウド (VPC) を介して環境を設定する方法の詳細については、Amazon Virtual Private Cloud ユーザーガイドを参照してください。

リモート Linux サーバーを準備するには、「リモート Linux サーバーを準備します。」を参照してください。

リモート Windows サーバーを準備するには、「Windows サーバーでリモートサーバー構成をセットアップする」を参照してください。

リモート Linux サーバーを準備します。

Linux サーバーでのキーベース認証をセットアップする

リモートサーバーの設定時に Linux に SSH キーベース認証を設定する場合は、Strategy Recommendations アプリケーションデータコレクターがデータを収集できるように、以下の手順を実行してサーバー上でキーベース認証を設定する必要があります。

Linux サーバーでキーベース認証をセットアップするには
  1. id_rsa_assessment.pub という名前で生成された公開鍵を、コンテナ内の次のフォルダーからコピーします。

    /opt/amazon/application-data-collector/remote-auth/linux/keys.

  2. コピーした公開鍵をすべてのリモートマシンの $HOME/.ssh/authorized_keys ファイルに追加します。使用可能なファイルがない場合は、touch または vim コマンドを使用して作成します。

  3. リモートサーバーのホームフォルダーのアクセス許可レベル 755 以下であることを確認してください。777 でない場合、動作しません。chmod コマンドを使用してアクセス許可を制限できます。

Linux サーバーでの証明書ベースの認証をセットアップする

リモートサーバーの設定時に Linux に証明書ベース認証を設定する場合は、Strategy Recommendations アプリケーションデータコレクターがデータを収集できるように、以下の手順を実行する必要があります。

既に Certificate Authority (CA) がアプリケーションサーバーに設定されている場合は、このオプションをお勧めします。

Linux サーバーで証明書ベースの認証をセットアップするには
  1. すべてのリモートサーバーで機能するユーザー名をコピーします。

  2. コレクターの公開鍵を CA にコピーします。

    コレクターの公開鍵は次の場所にあります。

    /opt/amazon/application-data-collector/remote-auth/linux/keys/id_rsa_assessment.pub

    証明書を生成するには、この公開鍵を CA に追加する必要があります。

  3. 前のステップで生成された証明書をコレクター内の次の場所にコピーします。

    /opt/amazon/application-data-collector/remote-auth/linux/keys

    証明書の名前は id_rsa_assessment-cert.pub である必要があります。

  4. セットアップの手順で証明書ファイル名を指定します。

Windows サーバーでリモートサーバー構成をセットアップする

コレクターのセットアップでリモート サーバー構成を構成するときに Windows のセットアップを選択した場合は、Strategy Recommendations がデータを収集できるように次の手順を実行する必要があります。

リモートサーバーで実行される PowerShell スクリプトの詳細については、このメモをお読みください。

このスクリプトは PowerShell リモートを有効にし、ネゴシエート以外のすべての認証方法を無効にします。これは Windows NT LAN Manager (NTLM) に使用され、"AllowUnencrypted" WSMman プロトコルを false に設定して、新しく作成されたリスナーが暗号化されたトラフィックのみを受け付けるようにします。Microsoft が提供しているスクリプト New-SelfSignedCertificateEx.ps1 を使用して、自己署名証明書を作成します。

HTTP リスナーを持つ WSMan インスタンスは、既存の HTTPS リスナーとともに削除されます。次に、新しい HTTPS リスナーを作成します。また、TCP ポート 5986 のインバウンドファイアウォールルールも作成します。最後のステップでは、WinRM サービスが再起動されます。

Windows 2008 サーバーのリモート接続によるデータ収集をセットアップするには
  1. サーバーにインストールされている PowerShell のバージョンを確認するには、次のコマンドを使用します。

    $PSVersionTable
  2. PowerShell のバージョンが 5.1 でない場合は、Microsoft ドキュメントの「WMF 5.1 のインストールと設定」の手順に従って WMF 5.1 をダウンロードしてインストールします。

  3. 新しい PowerShell ウィンドウで次のコマンドを使用して、PowerShell 5.1 がインストールされていることを確認します。

    $PSVersionTable
  4. Windows 2012 以降でリモート接続によるデータ収集を設定する方法を説明する次の手順に従います。

Windows 2012 以降のサーバーでリモート接続によるデータ収集をセットアップするには
  1. 次の URL から設定スクリプトをダウンロードします。

    https://application-data-collector-release.s3.us-west-2.amazonaws.com/scripts/WinRMSetup.ps1

  2. 次の URL から New-SelfSignedCertificateEx.ps1 をダウンロードし、ダウンロードした WinRMSetup.ps1 と同じフォルダにスクリプトを貼り付けます。

    https://github.com/Azure/azure-libraries-for-net/blob/master/Samples/Asset/New-SelfSignedCertificateEx.ps1

  3. セットアップを完了するには、ダウンロードした PowerShell スクリプトをすべてのアプリケーションサーバーで実行します。

    .\WinRMSetup.ps1
注記

Windows リモート管理 (WinRM) が Windows リモートサーバーで正しく設定されていない場合、そのサーバーからデータを収集しようとすると失敗します。その場合は、そのサーバーに対応する証明書をコンテナの次の場所から削除する必要があります。

/opt/amazon/application-data-collector/remote-auth/windows/certs/ads-server-id.cer

証明書を削除後、データ収集プロセスが再試行されるまでお待ちください。

次のステップ

ステップ 5: Migration Hub コンソールの Strategy Recommendations を使用してレコメンデーションを取得する

コレクターとサーバーがデータ収集用に設定されていることを確認する

次のコマンドで、コレクターとサーバーがデータ収集用に正しく設定されていることを確認します。

collector diag-check

このコマンドは、サーバー構成について一連の診断チェックを行い、チェックに失敗した場合は情報を表示します。

コマンドを -a モードで使用すると、チェックの完了後に DiagnosticCheckResult.txt ファイルに出力が表示されます。

collector diag-check -a

1 つのサーバーのサーバー構成を、そのサーバーの IP アドレスを使用して診断チェックできます。

次の例は、成功したセットアップの統合を示しています。

[Linux サーバー]

            Provide your test server IP address: IP address
---------------------------------------------------------------
Start checking connectivity & credentials... 
Connectivity and Credential Checks succeeded 
---------------------------------------------------------------
Start checking permissions... 
Permission Check succeeded 
---------------------------------------------------------------
Start checking OS version... 
OS version check succeeded 
---------------------------------------------------------------
Start checking Linux Bash installation... 
Linux Bash installation check succeeded 
---------------------------------------------------------------
All diagnostic checks complete successfully. 
This server is correctly set up and ready for data collection.
        

Windows Server

            Windows PowerShell Version Check succeeded 
Provide your test server IP address: IP address
---------------------------------------------------------------
Start checking connectivity & credentials... 
Connectivity and Credential Checks succeeded
--------------------------------------------------------------- 
Start checking permissions... 
Permission Check succeeded
--------------------------------------------------------------- 
Start checking OS version... 
OS version check succeeded
--------------------------------------------------------------- 
Start checking Windows architecture type... 
Windows Architecture Type Check succeeded 
---------------------------------------------------------------
All diagnostic checks complete successfully. 
This server is correctly set up and ready for data collection.
        

次の例は、リモートサーバーの資格情報が間違っている場合に表示されるエラーメッセージを示しています。

Unable to authenticate the server credentials with IP address ${IPAddress}. 
Ensure that your credentials are accurate and the server is configured correctly. 
Use the following command to reset incorrect credentials.
collector setup —remote-server-configurations