

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 將 EC2 Windows 執行個體擷取並遷移至 AWS Managed Services 帳戶
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account"></a>

*Anil Kunapareddy 和 Venkatramana Chintha，Amazon Web Services*

## 總結
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-summary"></a>

此模式說明將 Amazon Elastic Compute Cloud (Amazon EC2) Windows 執行個體遷移和擷取至 Amazon Web Services (AWS) Managed Services (AMS) 帳戶的step-by-step程序。AMS 可協助您更有效率且安全地管理執行個體。AMS 提供營運彈性、增強安全性和合規性，並協助您最佳化容量並降低成本。

此模式從您已遷移至 AMS 帳戶中臨時子網路的 EC2 Windows 執行個體開始。您可以使用各種遷移服務和工具來執行此任務，例如 AWS Application Migration Service。

若要變更 AMS 受管環境，您可以針對特定操作或動作建立並提交變更請求 (RFC)。使用 AMS 工作負載擷取 (WIGS) RFC，您可以將執行個體擷取至 AMS 帳戶並建立自訂 Amazon Machine Image (AMI)。然後，您可以透過提交另一個 RFC 來建立 EC2 堆疊來建立 AMS 受管 EC2 執行個體。如需詳細資訊，請參閱 [AMS 文件中的 AMS 工作負載擷取](https://docs.aws.amazon.com/managedservices/latest/appguide/ams-workload-ingest.html)。

## 先決條件和限制
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-prereqs"></a>

**先決條件**
+ 作用中的 AMS 受管 AWS 帳戶
+ 現有的登陸區域
+ 在 AMS 受管 VPC 中進行變更的許可
+ 您 AMS 帳戶中預備子網路中的 Amazon EC2 Windows 執行個體
+ 完成使用 AMS WIGS 遷移工作負載[的一般先決條件](https://docs.aws.amazon.com/managedservices/latest/appguide/ex-migrate-instance-prereqs.html) 
+ 完成使用 AMS WIGS 遷移工作負載的 [Windows 先決條件](https://docs.aws.amazon.com/managedservices/latest/appguide/ex-migrate-prereqs-win.html) 

**限制**
+ 此模式適用於操作 Windows Server 的 EC2 執行個體。此模式不適用於執行其他作業系統的執行個體，例如 Linux。

## Architecture
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-architecture"></a>

**來源技術堆疊**

AMS 帳戶中預備子網路中的 Amazon EC2 Windows 執行個體

**目標技術堆疊**

AWS Managed Services (AMS) 管理的 Amazon EC2 Windows 執行個體

**目標架構**

![將 Amazon EC2 Windows 執行個體遷移並擷取至 AWS Managed Services 帳戶的程序。](https://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/images/pattern-img/393c21cb-b6c6-4446-b597-b62e29fdb7f8/images/0b2fa855-7460-49f8-9e7f-3485e6ce1745.png)


## 工具
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-tools"></a>

**AWS 服務**
+ [Amazon Elastic Compute Cloud (Amazon EC2)](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/concepts.html) 在 AWS 雲端中提供可擴展的運算容量。您可以使用 Amazon EC2 視需要啟動任意數量或任意數量的虛擬伺服器，也可以向外擴展或向內擴展。
+ [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) 可透過控制已驗證並獲授權使用的人員，協助您安全地管理對 AWS 資源的存取。
+ [AWS Managed Services (AMS)](https://docs.aws.amazon.com/managedservices/?id=docs_gateway) 提供 AWS 基礎設施的持續管理，包括 AWS 工作負載的監控、事件管理、安全指導、修補程式支援和備份，協助您更有效率且安全地操作。

**其他服務**
+ [PowerShell](https://learn.microsoft.com/en-us/powershell/) 是在 Windows、Linux 和 macOS 上執行的 Microsoft 自動化和組態管理程式。

## 史詩
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-epics"></a>

### 在執行個體上設定設定
<a name="configure-settings-on-the-instance"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 變更 DNS 用戶端設定。 | 1. 在來源 EC2 執行個體上，以管理員身分開啟命令提示字元，輸入 `gpedit.msc`，然後按 **Enter** 鍵。<br />2. 在本機群組政策編輯器中，導覽至**電腦組態**、**管理範本**、**網路**、**DNS 用戶端**。<br />3. 針對**主要 DNS 尾碼**，選擇**未設定**。<br />4. 針對**主要 DNS 尾碼轉移**，選擇**未設定**。  | 遷移工程師 | 
| 變更 Windows Update 設定。 | 1. 在本機群組政策編輯器中，導覽至**電腦組態**、**管理範本**、**Windows 元件**、**Windows Update**。<br />2. 針對**指定內部網路 Microsoft 更新服務位置**，選擇**未設定**。<br />3. 針對**設定自動更新**，選擇**未設定**。<br />4. 針對**自動更新偵測頻率**，選擇**未設定**。<br />5. 關閉本機群組政策編輯器。 | 遷移工程師 | 
| 啟用防火牆。 | 1. 在來源 EC2 執行個體上，以管理員身分開啟命令提示字元，輸入 `services.msc`，然後按 **Enter** 鍵。<br />2. 在 Windows Services 中，啟用**防火牆**。<br />3. 關閉 Windows 服務。 | 遷移工程師 | 

### 準備 AMS WIGS 的執行個體
<a name="prepare-the-instance-for-ams-wigs"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 清除並準備執行個體。 | 1. 使用堡壘主機和本機登入資料，在預備子網路中建立 EC2 執行個體的遠端桌面通訊協定 (RDP) 連線。<br />2. 移除 AMS 中不需要的所有舊版軟體、防毒軟體和備份解決方案。  | 遷移工程師 | 
| 修復 sppnp.dll 檔案。 | 1. 前往 `C:\Windows\System32\sppnp.dll`。<br />2. 重新命名`sppnp.dll`為 ` sppnp_old.dll`。<br />3. 使用 PowerShell 和管理員登入資料，輸入下列命令：<pre>dism /online /cleanup-image /restorehealth<br />sfc /scannnow</pre><br />4. 重新啟動 EC2 Windows 執行個體。 | 遷移工程師 | 
| 執行預先 WIG 驗證指令碼。 | 1. 從遷移工作負載下載 Windows WIGS 擷取前驗證 zip 檔案 (`windows-prewings-valication.zip`)：AMS 文件中的 Windows 擷取前驗證。 [https://docs.aws.amazon.com/managedservices/latest/appguide/ex-migrate-instance-win-validation.html](https://docs.aws.amazon.com/managedservices/latest/appguide/ex-migrate-instance-win-validation.html)<br />2. 執行 Windows 預先 WIG 驗證指令碼並驗證結果。<br />3. 如果驗證失敗，請修正問題，並重新執行驗證指令碼，直到驗證成功為止。 | 遷移工程師 | 
| 建立故障安全 AMI。 | 在預先 WIG 驗證通過之後，建立擷取前 AMI，如下所示：1. 選擇**部署**、**進階堆疊元件**、**AMI**、**建立**。<br />2. 在建立期間，新增標籤 `Key=Name, Value=APPLICATION-ID_IngestReady`。<br />3. 請等待 AMI 建立後再繼續。<br />如需詳細資訊，請參閱 [AMS 文件中的 AMI \| Create](https://docs.aws.amazon.com/managedservices/latest/ctref/deployment-advanced-ami-create.html)。 | 遷移工程師 | 

### 擷取和驗證執行個體
<a name="ingest-and-validate-the-instance"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 提交 RFC 以建立工作負載擷取堆疊。 | 提交變更請求 (RFC) 以啟動 AMS WIGS。如需說明，請參閱 AMS 文件中的[工作負載擷取堆疊：建立](https://docs.aws.amazon.com/managedservices/latest/appguide/ex-workload-ingest-col.html)。這會啟動工作負載擷取，並安裝 AMS 所需的所有軟體，包括備份工具、Amazon EC2 管理軟體和防毒軟體。 | 遷移工程師 | 
| 驗證成功遷移。 | 工作負載擷取完成後，您可以看到 AMS 受管執行個體和 AMS 擷取的 AMI。1. 使用網域登入資料登入 AMS 受管執行個體。<br />2. 驗證加入的網域，如下所示：在 Windows Explorer 中，用滑鼠右鍵按一下**此 PC**，然後選擇**屬性**。在裝置規格區段中，確認網域出現在**完整裝置名稱**中。<br />3. 驗證來源和目標磁碟機。 | 遷移工程師 | 

### 在目標 AMS 帳戶中啟動執行個體
<a name="launch-the-instance-in-the-target-ams-account"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 提交 RFC 以建立 EC2 堆疊。 | 1. 使用 Windows 執行個體的 AMS 擷取 AMI，根據 AMS 文件中建立 EC2 堆疊執行個體的指示，為 EC2 堆疊準備 RFC。 [ EC2 ](https://docs.aws.amazon.com/managedservices/latest/ctexguide/ex-ec2-create-col.html) 在 EC2 堆疊 RFC 中，提供所有參數，包括伺服器名稱、標籤、目標 VPC、目標子網路、執行個體類型、目標安全群組、擷取 AMI 和角色。<br />2. 提交 EC2 堆疊的 RFC，然後等待執行個體成功建立。 | 遷移工程師 | 

## 相關資源
<a name="ingest-and-migrate-ec2-windows-instances-into-an-aws-managed-services-account-resources"></a>

**AWS 方案指引**
+ [在 Windows 上自動化 AWS Managed Services 的工作負載前擷取活動](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/automate-pre-workload-ingestion-activities-for-aws-managed-services-on-windows.html)
+ [使用 Python 在 AMS 中自動建立 RFC](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/automatically-create-an-rfc-in-ams-using-python.html?did=pg_card&trk=pg_card)

**AMS 文件**
+ [AMS 工作負載擷取](https://docs.aws.amazon.com/managedservices/latest/appguide/ams-workload-ingest.html)
+ [遷移如何變更您的資源](https://docs.aws.amazon.com/managedservices/latest/appguide/ex-migrate-changes.html)
+ [遷移工作負載：標準程序](https://docs.aws.amazon.com/managedservices/latest/appguide/mp-migrate-stack-process.html)

**行銷資源**
+ [AWS Managed Services](https://aws.amazon.com/managed-services/)
+ [AWS Managed Services FAQs](https://aws.amazon.com/managed-services/faqs/)
+ [AWS Managed Services 資源](https://aws.amazon.com/managed-services/resources/)
+ [AWS Managed Services功能](https://aws.amazon.com/managed-services/features/)