- 最新
- 投票最多
- 评论最多
i Have lot of ami's in my aws ec2 ami portal i want to move some of the ami to s3 bucket after moving to s3 bucket if i delete ami snapshot if it is possible to retrieve the ami through bucket
Please note that you can store an Amazon Machine Image (AMI) in an Amazon S3 bucket, and then restore it from the S3 bucket. The supported APIs for storing and restoring an AMI using S3 are CreateStoreImageTask, DescribeStoreImageTasks, and CreateRestoreImageTask.
Currently the store and restore APIs are only supported by using the AWS Command Line Interface, AWS SDKs, and Amazon EC2 API. You can’t store and restore an AMI using the Amazon EC2 console. Hence, please make sure that you have AWS CLI installed and updated to the latest version.
You can refer the section "Store an AMI in an S3 bucket" in the below documentation:
[+] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html#how-it-works
The limitations and IAM permissions required are also provided in the documentation. For your convenience, please refer the steps below:
- Store an AMI in an S3 bucket: you have to specify the ID of the AMI and the name of the S3 bucket in which to store the AMI:
aws ec2 create-store-image-task \
--image-id ami-1234567890abcdef0 \
--bucket myamibucket
- Describe the progress of an AMI store task:
aws ec2 describe-store-image-tasks
- Restore an AMI from an S3 bucket: you have to specify the object key of the AMI and the name of the S3 bucket to which the AMI was copied
aws ec2 create-restore-image-task \
--object-key ami-1234567890abcdef0.bin \
--bucket myamibucket \
--name "New AMI Name"
The CreateStoreImageTask API stores an AMI as a single object in an S3 bucket.
The API creates a task that reads all of the data from the AMI and its snapshots, and then uses an S3 multipart upload to store the data in an S3 object. The API takes all of the components of the AMI, including most of the non-Region-specific AMI metadata, and all the EBS snapshots contained in the AMI, and packs them into a single object in S3. The data is compressed as part of the upload process to reduce the amount of space used in S3, so the object in S3 might be smaller than the sum of the sizes of the snapshots in the AMI.
The object in S3 has the same ID as the AMI, but with a .bin extension. The time it takes to complete the task depends on the size of the AMI.
AMIs are stored in a S3 bucket you cannot see so what you are trying to do is not possible.
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前