Amazon Linux 2 是由 Amazon 开发和维护的 Linux 发行版。虽然它可以在其他云平台上运行,但 Amazon 不提供支持。
Migrate to Virtual Machines 可以将虚拟机上运行的 Amazon Linux 2 自动转换为 Google Cloud支持的操作系统。然后,虚拟机会迁移到 Google Cloud。如果您的虚拟机无法转换,您可以使用 Google Cloud 操作系统映像重新构建虚拟机,然后将数据从源虚拟机传输到重新构建的虚拟机。
如需将 Amazon Linux 2 工作负载迁移到 Google Cloud,请选择可用的迁移流程之一:
操作系统转换:使用此方法时,Migrate to Virtual Machines 会先尝试将在虚拟机实例上运行的 Amazon Linux 2 转换为 Rocky Linux 8。如果转换成功,Migrate to Virtual Machines 会完成迁移。此过程包括以下步骤:
开始复制来源虚拟机。复制过程会将 Amazon Linux 2 操作系统转换并升级到 Rocky Linux 8(包括所有已安装的软件包),并将虚拟机适配到 Compute Engine。
该虚拟机使用 Rocky Linux 8 启动。您现在可以设置目标详细信息,创建测试克隆并测试虚拟机。如果虚拟机按预期运行,您可以割接到 Google Cloud上的虚拟机。
虚拟机磁盘迁移:如果您不想执行自动操作系统转换,或者您的虚拟机不适合此流程,则可以选择将虚拟机的磁盘迁移到 Google Cloud上的永久性磁盘卷。此功能可帮助您使用官方支持或任何其他基础映像迁移来源虚拟机中的工作负载状态(虚拟机磁盘),并将其作为永久性磁盘卷挂接到 Google Cloud上的现有虚拟机或新虚拟机,同时最大限度地减少对工作负载的中断。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-21。"],[],[],null,["# Migrate an Amazon Linux 2 VM to Google Cloud\n\n| **Experimental**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** To inquire about this feature, send an email to the email address: [m2vm-amazon-linux-migration@google.com](mailto:m2vm-amazon-linux-migration@google.com).\n\nAmazon Linux 2 is a Linux distribution developed and\nmaintained by Amazon. While it can be run on other cloud platforms,\nit is not supported by Amazon.\n\nMigrate to Virtual Machines can automatically convert Amazon Linux 2 running on a VM to an operating system supported by Google Cloud. The VM is then migrated to Google Cloud.\nIf your VM cannot be converted, you can rebuild the VM using a Google Cloud OS image, and then transfer data from the source VM to the rebuilt VM.\n\nTo migrate your Amazon Linux 2 workloads to Google Cloud, choose one of\nthe available migration flows:\n| **Note:** Some VMs running Amazon Linux 2 cannot be automatically converted to Rocky Linux 8. For these VMs, we recommend that you use the VM disk migration flow to migrate your VM to Google Cloud.\n\n- **OS conversion**: In this approach, Migrate to Virtual Machines first attempts\n to convert the Amazon Linux 2 running on your VM instance to Rocky Linux 8.\n If the conversion is successful, Migrate to Virtual Machines completes the\n migration. This process includes the following steps:\n\n 1. Run the following command on your source VM. \n\n ```\n mkdir -p /etc/google/migrate/elevate_amazonlinux2_to_rocky\n ```\n 2. Start the [replication of the source VM](/migrate/virtual-machines/docs/5.0/migrate/migrating-vms#replication). The replication process converts and upgrades the Amazon Linux 2 OS to Rocky Linux 8 (including all installed packages), and adapts the VM to Compute Engine.\n\n The VM boots with Rocky Linux 8. You can now set the target details, create\n a test-clone and test the VM. If the VM works as expected, you can cut-over\n to the VM on Google Cloud.\n- **VM Disk migration** : If you don't want to perform an automated OS conversion, or if your VM is not suitable for this process,\n you can choose to [migrate your VM's disks to Persistent Disk volumes](/migrate/virtual-machines/docs/5.0/migrate/migrating-disks) on Google Cloud. This feature helps you migrate the\n workload state (VM disks) from a source VM and attach it as a Persistent Disk\n volume to an existing or new VM on Google Cloud, using an officially\n supported or any other base image, with minimal interruptions to the\n workload."]]