Attaching EBS at Amazon EC2 Spot Instance Launch

I would like to run an instance of Amazon EC2 as a CI server. To preserve historical information, I would like to save all the data on a separate EBS volume because the EBS volume of the spot instance will be deleted each time it is completed.

How to mount an EBS volume at startup?

Thanks, Ido.

+5
source share
2 answers

you may have a initscript that attaches an already accessible volume using this command:

ec2-attach-volume volume_id --instance instance_id --device device 

for this you need

  • EC2-API installed on the machine

  • you need to have EC2_PRIVATE_KEYand EC2_CERTas an environment variable or will need to be explicitly passed.

  • , , . , , .

  • curl http://169.254.169.254/latest/meta-data/instance-id instance_id.

:

, .

+5

API EC2 EBS.

. , , Linux

http://ec2dream.blogspot.com/search/label/EBS

script Ruby, Linux. , , bash.

Windows, . :

EBS Windows Amazon EC2

+2

All Articles