

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 AWS MGN 将 RHEL BYOL 系统迁移至 AWS License-Included 实例
<a name="migrate-rhel-byol-systems-to-aws-license-included-instances-by-using-aws-mgn"></a>

*Mike Kuznetsov，Amazon Web Services*

## Summary
<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 支持使用亚马逊机器映像（AMI） ID 的可扩展方法。本示例介绍了在大规模更换主机迁移期间，如何在 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>

**先决条件**
+ 访问目标 Amazon Web Services account 
+ AWS MGN 已在目标 Amazon Web Services account 和区域中初始化，以进行迁移（如果您已经从本地系统迁移至 AWS，则无需这样做）
+ 具有有效 RHEL 许可的源 RHEL 服务器

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

此示例介绍了两种场景：
+ 使用 AWS MGN 将系统从本地直接迁移至 AWS LI 实例。对于这种情况，请按照第一篇操作说明（*迁移至 LI 实例 - 选项 1*）和第三篇操作说明中的说明进行操作。
+ 将之前在 Amazon EC2 上运行的 RHEL 系统的许可模式从 BYOL 更改为 LI。对于这种情况，请按照第二篇操作说明（*迁移至 LI 实例*-*选项 2*）和第三篇操作说明中进行操作。

**注意**  
第三篇操作说明涉及重新配置新的 RHEL 实例，使其使用 AWS 提供的 Red Hat Update Infrastructure（RHUI）服务器。这两个场景的进程相同。

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

**Amazon Web Services**
+ [AWS Application Migration Service (AWS MGN)](https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html) 可帮助您将应用程序更换主机（直接迁移）到 Amazon Web Services Cloud 中，无需更改且停机时间最短。

## 操作说明
<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>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 在目标区域中查找 RHEL AWS LI 实例 AMI ID。 | 访问 [Amazon Web Services Marketplace](https://aws.amazon.com/marketplace) 或使用 [Amazon EC2 console](https://console.aws.amazon.com/ec2/) 查找与 RHEL 源系统版本匹配的 RHEL AMI ID（例如 RHEL-7.7），并写入 AMI I。在 Amazon EC2 控制台上 AMIs ，您可以使用以下搜索词之一进行筛选：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/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_cn/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_cn/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_cn/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>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 将 RHEL BYOL EC2 实例迁移至 AWS LI 实例。 | 您可以将之前作为 BYOL 迁移至 AWS 的 RHEL 系统切换到 AWS LI 实例，方法是移动其磁盘（Amazon Elastic Block Store 卷）并将其连接到新的 LI 实例。若要进行此切换，请按照以下步骤操作：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/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>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 从 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_cn/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_cn/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)
+ [获取支持的 AWS RHUI 客户端软件包 IMDSv2](https://access.redhat.com/solutions/5009491)（红帽知识库文章）
+ [Amazon EC2 启动模板](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html)（Amazon EC2 文档）