How do I save an AMI to a S3 bucket?
Asked Answered
O

3

15

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?

Ovariotomy answered 24/11, 2011 at 17:46 Comment(0)
C
5

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).

Citation answered 25/4, 2012 at 8:56 Comment(0)
R
1

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.

Rinarinaldi answered 24/11, 2011 at 18:13 Comment(1)
I think I need to do it myself..using a strange tool will not save me from future problems. To be onest the problem is very strange. Any idea where the EBS AMI instance is actually saved?..I mean physical location? When creating a AMI using the ec2-bundle-vol, I have access to the AMI(and the Manifest.xml) and I can upload it to the bucket...but in the case of creating a EBS AMI in the AWS console..where is the EBS AMI saved, can it be backuped on the S3? Any tips would be very helpful.Ovariotomy
B
1

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.

Biphenyl answered 18/1, 2021 at 6:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.