如何将 AMI 保存到 S3 存储桶?

发布于 2024-12-17 15:54:45 字数 167 浏览 3 评论 0原文

我已使用 Amazon AWS 控制台创建了 AMI(EBS AMI)。该 AMI 附加了 2 个快照。 现在我想将该 AMI 备份到 S3 存储桶。这可能吗?

我实际上需要执行此操作,然后才能将该 AMI 移动到不同区域中的存储桶并注册该 AMI 以在该不同区域中使用。

有什么线索吗?

I've created an AMI(EBS AMI) using the Amazon AWS console. That AMI has 2 snapshots attached to it.
Now I want to backup that AMI to a S3 bucket. Is this possible?

I actually need to do this to be able to then move that AMI to a bucket in a different region and register that AMI for use in that different region.

Any clues?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回眸一遍 2024-12-24 15:54:45

更新

我最初的回答仍然适用于此类问题(见下文),但是,考虑到您实际上需要执行此操作才能将该 AMI 移动到 [...] 不同的区域,您将会很高兴 AWS 刚刚发布了跨区域EC2 AMI复制来解决这个长期存在的功能请求:

AMI Copy 使您能够轻松地在之间复制 Amazon 系统映像
AWS 区域。 AMI Copy 有助于实现多个关键场景,包括:

  • 简单一致的多区域部署 - 您可以复制 AMI
    从一个地区到另一个地区,使您能够轻松启动一致的
    基于相同 AMI 的实例分布在不同区域。
  • 可扩展性 - 您可以更轻松地设计和构建世界规模的应用程序
    满足用户的需求,无论他们身在何处。
  • 性能 - 您可以通过分配您的
    应用程序并在其中找到应用程序的关键组件
    更接近您的用户。您还可以利用
    特定于区域的功能,例如实例类型或其他 AWS 服务。
  • 更高的可用性 - 您可以设计和部署应用程序
    跨 AWS 区域,以提高可用性。

初步答复

现在我想将该 AMI 备份到 S3 存储桶。这可能吗?

虽然 Amazon EBS 确实提供了创建卷的时间点快照的功能,这持久化到 Amazon S3,此操作超出您的控制范围,完全由 EC2 处理,请参阅相应的常见问题解答我能够使用常规 Amazon S3 API 访问我的快照吗?

不可以,快照只能通过 Amazon EC2 API 获取。

您可以按照 Eric Hammond 的详细文章在 EC2 区域之间复制 EBS 启动 AMI,它将指导您完成所有必需的步骤(尽管相当多)。

Update

My initial answer still applies concerning the question as such (see below), however, given you actually need to do this to be able to then move that AMI to [...] a different region, you will be pleased that AWS has just released Cross Region EC2 AMI Copy to address this long standing feature request:

AMI Copy enables you to easily copy your Amazon Machine Images between
AWS Regions. AMI Copy helps enable several key scenarios including:

  • Simple and Consistent Multi-Region Deployment - You can copy an AMI
    from one region to another, enabling you to easily launch consistent
    instances based on the same AMI into different regions.
  • Scalability - You can more easily design and build world-scale applications that
    meet the needs of your users, regardless of their location.
  • Performance - You can increase performance by distributing your
    application and locating critical components of your application in
    closer proximity to your users. You can also take advantage of
    region-specific features such as instance types or other AWS services.
  • Even Higher Availability - You can design and deploy applications
    across AWS regions, to increase availability.

Initial Answer

Now I want to backup that AMI to a S3 bucket. Is this possible?

While Amazon EBS indeed provides the ability to create point-in-time snapshots of volumes, which are persisted to Amazon S3, this operation is outside of your control and entirely handled by EC2, see the respective FAQ Will I be able to access my snapshots using the regular Amazon S3 APIs?:

No, snapshots are only available through the Amazon EC2 APIs.

You can achieve your goal by following Eric Hammond's elaborate article Copying EBS Boot AMIs Between EC2 Regions, which guides you through all required steps (quite some though).

简单气质女生网名 2024-12-24 15:54:45

这不是一项微不足道的任务。我在许多博客和参考文献中看到过这个网站,但我自己没有使用过。

您可能想尝试CloudScripts,特别是为了满足您的需要,这个特定的脚本:https://cloudyscripts.com/tool/show/4

希望这有帮助。

That is not a trivial task. I have seen this site referenced in many blogs and references, but I have not used it myself.

You might want to try CloudScripts and in particular for your needs this particular script: https://cloudyscripts.com/tool/show/4

Hope this helps.

や莫失莫忘 2024-12-24 15:54:45

除了 AMI 复制功能,现在您还可以使用 AWS CLI 将它们导出到 S3 或从 S3 导入它们。

检查:https://docs.aws.amazon。 com/cli/latest/reference/ec2/export-image.html

您可以使用 VMDK 作为导出/导入格式。

就我而言,我在导出和参考期间遇到了一些与角色相关的奇怪问题

请注意,您可能还需要授予 s3 写入权限以及附加的策略。

Other than AMI Copy feature, now you can use AWS CLI to export and import them to and from S3.

Check: https://docs.aws.amazon.com/cli/latest/reference/ec2/export-image.html

You can use VMDK as the export/import format.

In my case I encountered some strange Role related issue during the export and the reference here helped.

Please be aware that you might need to give the s3 write permission as well to your policies attached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文