Is there a way to attach an AMI, or a copy thereof, to an instance? This would be a non-pay public Linux AMI. An example would be the Ubuntu 12.04 LTS AMI. But I don't want to be limited to just that one, either (so a copy of it elsewhere, while nice to know, isn't the answer). In particular, what I am trying to avoid is making a copy that is running or has been run.
The test would then be to make a snapshot of that, and register that as an AMI, and it would be an exact copy. My intention would be to modify the copy (as my own volume). But my modifications would not work if it is a root device initially (since the transition of changes would cause a crash).
Can you see the source file system for an AMI? No, Maybe, Yes:
NO: Most public AMIs do not make the source EBS snapshot publicly readable, so you can't look at the contents without running an instance of the AMI.
MAYBE: You can try running an instance of the AMI and then immediately "stop" it while it is "pending" in the hopes that it goes into the "stopped" state before the OS starts booting. Detach the root EBS volume from that instance and attach it to another instance to view the file system. This method cannot be used with AMIs in the AWS Marketplace as they are specially protected.
YES: Some companies that publish AMIs also publish copies of the file system image used to create the AMIs. For example, the file systems used to create Ubuntu AMIs are published by Canonical here:
You can download the Ubuntu 12.04 LTS Precise image you reference here:
This can be used to create new AMIs using the method you describe.
This is possible if you are using EBS backed AMIs. It might be possible with S3 backed, but it may take more digging.
Start a fresh instance with the AMI you want to duplicate. This will create a new ~8GB EBS volume as the root device.
Stop this new instance (not terminate)
Detach the Root EBS drive (/dev/sda1) from the fresh, recently stopped instance.
Attach this to another instance like a regular EBS drive. Manipulate as you wish.
Snapshot the Drive.
Convert the Snapshot to an AMI using the AWS Console.