How to transfer image to Amazon EBS volume to use EC2?

I have a local file system image that I want to transfer to an Amazon EBS volume and boot as an EC2 micro instance. The instance must have the EBS volume as the root file system - and I will load the instance with the Amazon PV-GRUB kernels.

I used the ec2-bundle image to create a package from the image, and I used the ec2 download package to download the package in Amazon S3. However, now that I would like to use ec2-register to register the image to use, I cannot find a way to make the downloaded package an image of the ebs root. It would seem that creating a root device requires an EBS snapshot, and I don’t know how to convert a package to an EBS snapshot.

I understand that perhaps I could do this by starting a “shared” instance, adding an EBS volume to it, and then just using “scp” or something to transfer the image directly to that EBS, but this is really the only way ? In addition, I have no desire to use EBS snapshots as such, I would prefer not to - can I create a micro-instance with only the EBS volume as root without an EBS snapshot?

+6
amazon-s3 amazon-web-services amazon-ec2 amazon-ebs
source share
2 answers

Did not find a way to do this :(

So, I created a new instance, mounted the newly created EBS volume, bound it to the instance, and passed the data through ssh.

Then, in order to be able to load the volume, I still need to create a snapshot of it, and then create an AMI that uses the snapshot, and as a result, I get another EBS volume created from the snapshot and the current volume of the root instance.

Now, if I want to minimize costs, I can delete the created snapshot and the original EBS volume.

NOTE. If the only copy of the EBS volume is the root volume of the instance, it can be deleted at the end of the instance. This parameter can be changed using the command-line tools - or the instance can be simply “stopped” instead of “completed”, and then a snapshot can be taken from the EBS volume. After a snapshot, the instance, of course, can be interrupted.

+2
source share

Yes, there is no way to upload an EBS image through S3 and use an instance where you attach an additional volume is the best way. If you attach this volume after starting the instance, it will not be deleted either.

Please note: do not worry about Volume-> snapshot-> Volume, as they use the same data blocks (unless you modify them). The storage cost has not tripled, only 1.1 times one volume. ECDs and imaging are very convenient in this regard. Feel free to use multiple shots. The less you “work” in the snapshot, the less will be its use of the block later if you start it as AMI.

+2
source share

All Articles