How to create an instance AMI instance of a reserved instance instance without EBS

I have several microlevels with EBS volumes, and from the ec2 console you can right-click and create an AMI image of the entire system.

But I bought some reserved high-memory instances that had 500 GB of memory, so I installed the ubuntu AMI "store instance" image

Now I have configured everything on my server and I want to create an image of the ami image of the instance so that I can install these images on new servers, and I do not need to install everything again

Could you help me how can I do this.

thanks

+6
source share
1 answer

Here's how you do it with Ubuntu: Run your desired instance from here (select one without EBS storage): http://cloud-images.ubuntu.com/releases/precise/release/

Follow this guide here (see below to learn about Ubuntu): http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-snapshot-s3-linux.html

  • First, you need to create your public key and certificate using this guide (you will need them later): http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-credentials.html#using-credentials-certificate
  • Also pay attention to your AWS account ID: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-credentials.html#using-credentials-account-id
  • Download pk and cert to your ubuntu instance that you downloaded: scp -i <path-to-your-ec2key>.pem <your-account-pk>.pem <your-account-cert>.pem ubuntu@ <yourinstance>.<yourzone>.compute.amazonaws.com:~/
  • This puts the pk file and cert file in your home directory in your working instance. Now go in and move them to the / mnt directory so that they do not turn on when combining your AMI.
  • Now change your image to your content.
  • Install AMI tools AMI: sudo apt-get install ec2-ami-tools
  • To create a package, run the following command: ec2-bundle-vol -k <your-account-pk>.pem -c <your-account-cert>.pem -u <user_id>
  • Se to the right above for the rest. You need to download the package to S3 and then register AMI so that you can run it.

Good luck

+6
source

Source: https://habr.com/ru/post/921529/


All Articles