Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create ami instance programmatically?

lately I am doing some POC's in amazon elastic cloud. I created a sample instance and I uploaded my sample web application and finally saw my hello world jsp.

Now I am trying to create one more instance and want to send data from my first instance to second instance. I know that this can be achieved through zookeeper. But I want to create my second instance programmatically and not through the management console.

How to achieve this? I am thinking that this has something to do with the amazon s3 where we bundle our ami. But not sure about it. Can anyone give me guidelines?

like image 675
karthick Avatar asked Sep 10 '11 13:09

karthick


People also ask

Can we create AMI of instance store?

To create an instance store-backed Linux AMI, start from an instance that you've launched from an existing instance store-backed Linux AMI. After you've customized the instance to suit your needs, bundle the volume and register a new AMI, which you can use to launch new instances with these customizations.

Can we create AMI from EBS?

To create an AMI from a snapshot using the consoleIn the navigation pane, under Elastic Block Store, choose Snapshots. Choose the snapshot and choose Actions, Create Image. In the Create Image from EBS Snapshot dialog box, complete the fields to create your AMI, then choose Create.

What is an AMI instance?

An Amazon Machine Image (AMI) is a template that contains a software configuration (for example, an operating system, an application server, and applications). From an AMI, you launch an instance, which is a copy of the AMI running as a virtual server in the cloud.


1 Answers

This is a link to the Amazon documentation for creating an AMI. Amazon provide a set of command line tools so you should be able to call these from your script.

you may also find these 3rd party scripts useful for creating a bootable EBS from a running instance.

Or it may be more useful to invoke the AWS EC2 APIs more directly from your application.

like image 174
Ray Vahey Avatar answered Oct 26 '22 17:10

Ray Vahey