Deleting Community AMI - amazon-ec2

What happens when you make private/delete/de-register an AMI that has been shared with the AWS AMI Catalog?
Is the catalog entry now a dead link or does it automatically disappear?
Will you have to go through the submission process again to re-add the AMI to the catalog?

Related

Need to replicate EC2 machine from non-China Region to China region

I want to make exact replica of my server in non China region to China region. AWS wont allow AMI copy into china, Is there a way of achieving my goal. ?
Already tried [1], but didn't worked for me. would like to hear if anyone have done [1] successfully.
[1]https://forums.aws.amazon.com/thread.jspa?threadID=178941
You can easily transfer or copy your AMI to another region. There has some ways. Most easiest way is to use the Copy AMI options.
Click on your instance -> Create Image .
From AMI lists -> Select your newly created AMI -> Copy AMI -> Select region where you want to take it. After that it will be available in that region after couple mins. Then from that region, you can simply re-create your instance with this AMI. This is simple.
Another way is, if AWS don't allow you to copy your AMI in China region, then you just create another account in China Region and then from your AMI list, just give the permission to your china region AWS account, and it will be available in your china region account and you can re-create instance from there. Though, I never dealt with china region in AWS, but it should work.

How to save a modified AMI?

I'm using a community AMI, it's great but some of the stuff in it is outdated. Every time I spin up a new machine based on it I have to update all the libraries. I want to instead update them once and save the modified image. It's and EBS backed AMI. I tried creating a snapshot off of the volume of the running instance and then creating an AMI from the snapshot. The resulting AMI does indeed have all the modifications I made but the operating system is different! The original AMI has ubuntu while the thing that comes out is "other linux" - and some things are not working (CUDA). Both "RAM disk ID" and "kernel ID" in the original AMI details are blank so I leave them as "default" when creating the new AMI.
The preferred way to save a modified EC2 instance is to burn an AMI directly from the running instance, rather than taking a snapshot of its root volume.
If for any reason all you had was a snapshot of the root volume of a previously running instance, to create a bootable AMI you have to follow the following process: launch one of the stock EC2 AMIs, one that has the same OS as your EBS snapshot. Create an EBS volume from that snapshot. Stop the newly launched instance. Detach the root volume, and attach the new volume you created form the EBS snapshot as the root volume and start the instance. See Launching a Linux Instance from a Backup. NOTE: Although you can create a Windows AMI from a snapshot, you cannott successfully launch an instance from the AMI.
The easiest way to save an AMI with new modificationa, is to create the AMI image directly from the running instance, and not simply take a snapshot of the running volume.
From the AWS Management Console, click on the instance, then right-click Image -> Create Image.
From that dialog, set the Name, Description etc. Make sure to leave No Reboot unchecked. From the Instance Volumes section adjust the volume settings.
Note that your instance will reboot during the image creation process. Make sure you are prepared for the temporary loss of service of the instance during this time.

How to get my AMI manifest path from EC2 user interface?

I'm trying to share my AMI with a colleague, who is testing his change to my cluster computing application.
While it is easy to change the permission of my AMI to 'public', I can't find its manifest anywhere, including in my S3 buckets.
Is this feature missing for AMI created in EC2 console?
A manifest is only required for an Instance-Store Backed AMI. This is where the AMI is copied to Instance Store (ephemeral storage) rather than an EBS volume. This method is quite old and these days it is recommended to use a normal AMI that is used to create an EBS boot volume.
AMIs created in the EC2 Management Console can be shared either publicly or with with specific accounts.

Amazon EC2 - Create a new EBS backed AMI with custom AMI ID

I have an EBS-backed AMI instance running in EC2. I have customized it and now want to create a new AMI from it. I will doing this at regular intervals, thereby replacing the previous AMIs created.
I followed the instructions at
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html
and everything worked perfectly.
One problem is that whenever, I create a new AMI, it gets a new AMI ID. So, when I make the AMI public whenever, I update the AMI, it's AMI ID changes. Is it possible to create a new AMI with a custom ID we can specify?
One alternative would be modify an existing AMI, so that the AMI ID remains the same. Please confirm if this is possible
Each time you create a new AMI, you will get a new id. There is unfortunately no way around this.
An alternative would be to update some of the AMI at launch, provided that it can be done relatively quickly. That way you wont need to create a new AMI every time something changes.
It is not possible to modify the contents of an AMI once you have created it such that the next time the AMI is used those changes will be present. This includes the root device and any data in EBS snapshots associated with the AMI (since it's not possible to alter the contents of an EBS snapshot, either).

Can I make an AMI from a running instance that uses instance-store as its root device?

Or is it absolutely necessary to have an EBS backed storage? Does anyone have manuals/Howtos?
I am following the manual given on this site.
You can create an AMI from either an EBS or S3-backed running instance. The simplest way is to use the AWS Management Console to select the instance and click 'Create Image' from the Instance Actions menu.
This will create either an EBS or S3-backed AMI, depending on the type of instance.
Be aware that creating an AMI from a Running instance is inherently potentially unsafe - the storage is not imaged as a hard 'point-in-time' snapshot, so changes to the filesystem whilst the image is being created may not be recorded, and may even result in a compromised image. You should quiesce the OS as far as possible before starting.
Note also that your instance will reboot during the image-creation process, so make sure you're prepared for any temporary loss of service from the VM.
If you bundle a Windows EBS instance while it is running, its Administrator password will be reset by Amazon's rebundling tools - so you'll have to use the EC2 "get Admin password" function with instances launched from the new AMI.
If you stop your Windows instance before rebundling, its Administrator password will remain intact through the rebundling process.
I don't know if this is documented anywhere, but it's certainly been my experience with Windows 2003 instances.
you will to refer the manual for the three commands:
ec2-bundle-vol, ec2-upload-bundle, ec2-register.
Keep at hand your private and certificate key (eg. pk.pem, cert.pem files) and your access and shared key. Download the ec2 ami tools and setup the environment variables for the ec2 ami tools. This site might give you the details on how to bundle the volume, create the images, upload them to S3 and finally register it as your own ami.
http://alestic.com/2009/06/ec2-ami-bundle
It is possible to create an AMI from an EBS running instance using the AWS management console. as mentioned by Eight-Bit Guru by clicking 'Create Image' from the Instance Actions menu.
For the S3 backed instance it is currently not possible without bundling the instance.
If you are using a linux ami then you have two ways as explained in this guide:
Creating an AMI from S3 backed instance - For Linux
For windows based S3 backed instance you can follow other guide
Creating an AMI from S3 backed instance - For Windows
Hope this will help for creating an AMI for S3 backed intances.

Resources