

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

# 使用 AWS MGN 將 RHEL BYOL 系統遷移至包含 AWS 授權的執行個體
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn"></a>

*Mike Kuznetsov，Amazon Web Services*

## 摘要
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-summary"></a>

當您使用 AWS Application Migration Service (AWS MGN) 將工作負載遷移至 AWS 時，您可能需要在遷移期間將 Red Hat Enterprise Linux (RHEL) 執行個體提升和轉移 （恢復），並將授權從預設自帶授權 (BYOL) 模型變更為 AWS License Included (LI) 模型。AWS MGN 支援使用 Amazon Machine Image (AMI) IDs可擴展方法。此模式說明如何在大規模重新託管遷移期間，在 RHEL 伺服器上完成授權變更。它還說明如何變更已在 Amazon Elastic Compute Cloud (Amazon EC2) 上執行的 RHEL 系統授權。

## 先決條件和限制
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-prereqs"></a>

**先決條件**
+ 存取目標 AWS 帳戶
+ 在目標 AWS 帳戶和區域中初始化的 AWS MGN 以進行遷移 （如果您已經從現場部署系統遷移至 AWS，則不需要）
+ 具有有效 RHEL 授權的來源 RHEL 伺服器

## Architecture
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-architecture"></a>

此模式涵蓋兩個案例：
+ 使用 AWS MGN 將系統從內部部署直接遷移到 AWS LI 執行個體。在此案例中，請遵循第一個 epic (*遷移至 LI 執行個體 - 選項 1*) 和第三個 epic 中的指示。
+ 針對已在 Amazon EC2 上執行的先前遷移 RHEL 系統，將授權模型從 BYOL 變更為 LI。在此案例中，請遵循第二個 epic (*遷移至 LI 執行個體* - *選項 2*) 和第三個 epic 中的指示。

**注意**  
第三個史詩涉及重新設定新的 RHEL 執行個體，以使用 AWS 提供的 Red Hat Update Infrastructure (RHUI) 伺服器。這兩個案例的此程序都相同。

## 工具
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-tools"></a>

**AWS 服務**
+ [AWS Application Migration Service (AWS MGN)](https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html) 可協助您將應用程式重新託管 （提升和轉移） 至 AWS 雲端，無需變更且停機時間最短。

## 史詩
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-epics"></a>

### 遷移至 LI 執行個體 - 選項 1 （適用於內部部署 RHEL 系統）
<a name="migrate-to-li-instance---option-1-for-an-on-premises-rhel-system"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 尋找目標區域中 RHEL AWS LI 執行個體的 AMI ID。 | 請造訪 [AWS Marketplace](https://aws.amazon.com/marketplace) 或使用 [Amazon EC2 主控台](https://console.aws.amazon.com/ec2/)尋找符合 RHEL 來源系統版本的 RHEL AMI ID （例如 RHEL-7.7)，然後寫下 AMI ID。在 Amazon EC2 主控台上，您可以使用下列其中一個搜尋詞彙來篩選 AMIs：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html) | 雲端管理員 | 
| 設定 AWS MGN 啟動設定。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html)AWS MGN 現在將使用此版本的啟動範本來啟動測試或切換執行個體。如需詳細資訊，請參閱 [AWS MGN 文件](https://docs.aws.amazon.com/mgn/latest/ug/ec2-launch.html)。 | 雲端管理員 | 
| 驗證設定。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html) | 雲端管理員 | 
| 啟動新的 LI 執行個體。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html) | 雲端管理員 | 

### 遷移至 LI 執行個體 - 選項 2 （適用於 RHEL BYOL EC2 執行個體）
<a name="migrate-to-li-instance---option-2-for-a-rhel-byol-ec2-instance"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 將 RHEL BYOL EC2 執行個體遷移至 AWS LI 執行個體。 | 您可以透過移動 RHEL 系統磁碟 (Amazon Elastic Block Store 磁碟區） 並將其連接至新的 LI 執行個體，將先前以 BYOL 形式遷移至 AWS 的 RHEL 系統切換至 AWS LI 執行個體。若要進行此切換，請依照下列步驟進行：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html) | 雲端管理員 | 

### 重新設定 RHEL 作業系統以使用 AWS 提供的 RHUI – 這兩個選項
<a name="reconfigure-rhel-os-to-use-aws-provided-rhui-ndash-both-options"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 從 Red Hat 訂閱和授權取消註冊作業系統。 | 在遷移和成功切換後，必須從 Red Hat 訂閱中移除 RHEL 系統，以停止耗用 Red Hat 授權並避免重複計費。若要從 Red Hat 訂閱中移除 RHEL 作業系統，請遵循 [Red Hat 訂閱管理 (RHSM) 文件](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/installation_guide/chap-subscription-management-unregistering)中所述的程序。使用 CLI 命令： <pre>subscription-manager unregister</pre>您也可以停用訂閱管理員外掛程式，以停止檢查每次 **yum** 呼叫的訂閱狀態。若要這樣做，請編輯組態檔案並將 參數`/etc/yum/pluginconf.d/subscription-manager.conf`變更為 `enabled=1` `enabled=0`。 | Linux 或系統管理員 | 
| 使用 AWS 提供的 RHUI 取代舊的更新組態 (RHUI、Red Hat Satellite 網路、yum 儲存庫）。 | 您必須重新設定遷移的 RHEL 系統，才能使用 AWS 提供的 RHUI 伺服器。這可讓您存取 AWS 區域內的 RHUI 伺服器，而不需要外部更新基礎設施。變更包含下列程序：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html)以下是詳細的步驟和命令：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn.html) | Linux 或系統管理員 | 
| 驗證組態。 | 在目標遷移執行個體上，驗證新組態是否正確：<pre>sudo yum clean all <br />sudo yum repolist </pre> | Linux 或系統管理員 | 

## 相關資源
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn-resources"></a>
+ [AWS Application Migration Service (AWS MGN) 使用者指南](https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html)
+ [取得支援 IMDSv2 的 AWS RHUI 用戶端套件](https://access.redhat.com/solutions/5009491) (Red Hat 知識庫文章）
+ [Amazon EC2 啟動範本](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html) (Amazon EC2 文件）