0

I am trying to make android x86 ami on amazon.

I am following tutorial here https://github.com/ashishdahiya/android_x86_64_ami

I am able to boot android but can not install any apk file.

also i have successfully create instance stored ami but i can not stop it and can not take snapshot of it.

I am doing like this.

1) ec2-bundle-image --cert secret/certificate.pem --privatekey secret/private-key.pem --image image/android_x86_64.img --prefix android-x86 --user 5924176***** --destination ami1 -a x86_64 --kernel aki-fc37bacc -B "/dev/sda1=snap-0f1633ad782df8db4::true"

2) ec2-upload-bundle --manifest ami1/android-x86.manifest.xml --bucket testbuckette12345 --access-key ****** --secret-key ***

3) ec2-register testbuckette12345/android-x86.manifest.xml -n "ng1final1" -a x86_64 -d "zAsnffdroid x86 6 AMI" --region us-west-2 -O AKI**** -W Sk2ZL9****** --kernel aki-fc37bacc --root-device-name /dev/sda1 -b "/dev/sda1=snap-0f1633ad782df8db4::true"

It will be grateful if you can help. Thank you

1 Answers1

0

An Amazon EC2 instance that is started from an Instance Store-backed AMIs cannot be stopped/started. This is because the boot disk is kept on Instance Store, which is deleted when the instance is stopped. Since the disk is gone, the instance cannot be started again (and that's also why you aren't permitted to Stop it).

Similarly, Amazon EBS Snapshots can only be made from Amazon EBS disk volumes. Instance Store is directly-attached disk storage that is not Amazon EBS.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • can you provide solution. how to change boot disk ? – Gaurang Mody Jun 11 '17 at 22:14
  • When you get to the step about Creating the AMI, simply use the "Create Image" command from the Actions menu in the console and the normal EBS-backed AMI will be created. Documentation: [Creating an Amazon EBS-Backed Linux AMI](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) – John Rotenstein Jun 12 '17 at 01:53
  • Could you please provide more information -- what do you mean by "not able to create image"? – John Rotenstein Jun 12 '17 at 05:07
  • i am creating ami from scratch using cli. please look at question. i have editted – Gaurang Mody Jun 12 '17 at 05:41
  • The instructions you pasted are, indeed, creating an instance store-backed AMI. That is the reason you cannot Stop or Snapshot an instance created from the AMI. If you create an AMI via the console (Create Image) or via the [AWS Command-Line Interface (CLI)](http://aws.amazon.com/cli/) `aws ec2 create-image` command, then it will be an Amazon EBS-backed AMI. – John Rotenstein Jun 12 '17 at 06:12
  • can you provide some example for `aws ec2 create-image` for creating image from scratch. i have read about `aws ec2 create-image` it defines only image from running EBS instances. – Gaurang Mody Jun 12 '17 at 11:58
  • The article that you followed starts by creating an Amazon EC2 instance using EBS storage. Therefore, you can just use the Create Image command (either from the web console, which is easier, or from the command line) to create the AMI. Then, any instance you start from that AMI will use EBS storage, you will be able to start/stop it and make snapshots. – John Rotenstein Jun 12 '17 at 12:34
  • i am not able to create image from the web console. can you provide example of creating ebs ami from the scratch ? create image is for creating image from a running instacnce – Gaurang Mody Jun 13 '17 at 14:43
  • Step 1: Launch an Amazon EC2 using the topmost Amazon Linux AMI. Step 2: Stop your instance (Optional). Step 3: Choose Actions/Create Image. Done! – John Rotenstein Jun 13 '17 at 21:04
  • it will create image of linux ami i guess. i am making my own(android) from scratch – Gaurang Mody Jun 15 '17 at 18:34