JAVA_HOME=/usr/java
EC2_HOME=$HOME/local/ec2-api-tools
EC2_URL=http://us-east-1.ec2.amazonaws.com
export JAVA_HOME EC2_HOME EC2_URL



$ export EC2_PRIVATE_KEY=~/.ec2/pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem
$ export EC2_CERT=~/.ec2/cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem


ec2-add-keypair gsg-keypair
KEYPAIR gsg-keypair 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f
-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp
HungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg
5AU52EQfanIn3ZQ8lFW7Edp5a3q4DhjGlUKToHVbicL5E+g45zfB95wIyywWZfeW/UUF3LpGZyq/
ebIUlq1qTbHkLbCC2r7RTn8vpQWp47BGVYGtGSBMpTRP5hnbzzuqj3itkiLHjU39S2sJCJ0TrJx5
i8BygR4s3mHKBj8l+ePQxG1kGbF6R4yg6sECmXn17MRQVXODNHZbAgMBAAECggEAY1tsiUsIwDl5
91CXirkYGuVfLyLflXenxfI50mDFms/mumTqloHO7tr0oriHDR5K7wMcY/YY5YkcXNo7mvUVD1pM
ZNUJs7rw9gZRTrf7LylaJ58kOcyajw8TsC4e4LPbFaHwS1d6K8rXh64o6WgW4SrsB6ICmr1kGQI7
3wcfgt5ecIu4TZf0OE9IHjn+2eRlsrjBdeORi7KiUNC/pAG23I6MdDOFEQRcCSigCj+4/mciFUSA
SWS4dMbrpb9FNSIcf9dcLxVM7/6KxgJNfZc9XWzUw77Jg8x92Zd0fVhHOux5IZC+UvSKWB4dyfcI
tE8C3p9bbU9VGyY5vLCAiIb4qQKBgQDLiO24GXrIkswF32YtBBMuVgLGCwU9h9HlO9mKAc2m8Cm1
jUE5IpzRjTedc9I2qiIMUTwtgnw42auSCzbUeYMURPtDqyQ7p6AjMujp9EPemcSVOK9vXYL0Ptco
xW9MC0dtV6iPkCN7gOqiZXPRKaFbWADp16p8UAIvS/a5XXk5jwKBgQCKkpHi2EISh1uRkhxljyWC
iDCiK6JBRsMvpLbc0v5dKwP5alo1fmdR5PJaV2qvZSj5CYNpMAy1/EDNTY5OSIJU+0KFmQbyhsbm
rdLNLDL4+TcnT7c62/aH01ohYaf/VCbRhtLlBfqGoQc7+sAc8vmKkesnF7CqCEKDyF/dhrxYdQKB
gC0iZzzNAapayz1+JcVTwwEid6j9JqNXbBc+Z2YwMi+T0Fv/P/hwkX/ypeOXnIUcw0Ih/YtGBVAC
DQbsz7LcY1HqXiHKYNWNvXgwwO+oiChjxvEkSdsTTIfnK4VSCvU9BxDbQHjdiNDJbL6oar92UN7V
rBYvChJZF7LvUH4YmVpHAoGAbZ2X7XvoeEO+uZ58/BGKOIGHByHBDiXtzMhdJr15HTYjxK7OgTZm
gK+8zp4L9IbvLGDMJO8vft32XPEWuvI8twCzFH+CsWLQADZMZKSsBasOZ/h1FwhdMgCMcY+Qlzd4
JZKjTSu3i7vhvx6RzdSedXEMNTZWN4qlIx3kR5aHcukCgYA9T+Zrvm1F0seQPbLknn7EqhXIjBaT
P8TTvW/6bdPi23ExzxZn7KOdrfclYRph1LHMpAONv/x2xALIf91UB+v5ohy1oDoasL0gij1houRe
2ERKKdwz0ZL9SWq6VTdhr/5G994CK72fy5WhyERbDjUIdHaK3M849JJuf8cSrvSb4g==
-----END RSA PRIVATE KEY-----



$ ec2-run-instances ami-0459bc6d -k cfe
RESERVATION	r-e9853e81	570955437877	default
INSTANCE	i-bbf3d6d3	ami-0459bc6d			pending	cfe	0m1.small	2009-12-29T01:50:29+0000	us-east-1c			monitoring-disabled



$ ec2-describe-instances i-bbf3d6d3
RESERVATION	r-e9853e81	570955437877	default
INSTANCE	i-bbf3d6d3	ami-0459bc6d	ec2-67-202-38-138.compute-1.amazonaws.com	domU-12-31-39-09-BD-42.compute-1.internal	running	cfe	0m1.small	2009-12-29T01:50:29+0000	us-east-1c			monitoring-disabled	67.202.38.138	10.210.194.176			instance-store



$ ec2-authorize default -p 80
GROUP		default
PERMISSION		default	ALLOWS	tcp	80	80	FROM	CIDR	0.0.0.0/0



$ ec2-authorize default -p 22 -s 201.103.149.0/24
GROUP		default
PERMISSION		default	ALLOWS	tcp	22	22	FROM	CIDR	201.103.149.0/24



$ LANG=C ssh -i Documents/aws/cfe/cfe\-privatekey root@>
The authenticity of host 'ec2-67-202-38-138.compute-1.amazonaws.com (67.202.38.138)' can't be established.
RSA key fingerprint is 80:9a:01:bd:09:c8:b3:d6:79:9f:7f:57:7c:05:67:38.
Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added 'ec2-67-202-38-138.compute-1.amazonaws.com,67.202.38.138' (RSA) to the list of known hosts.
-bash-3.1#


###


$ yum install ruby



$ rpm -Uvh ec2-ami-tools.noarch.rpm



RUBYLIB=/usr/lib/site_ruby
PATH=$PATH:$HOME/bin

export RUBYLIB PATH



$ depmod -a
$ modprobe loop


Descarga EC2 API tools



VOLUME	vol-754e8a1c	10		us-east-1c	creating	2009-12-29T07:21:31+0000

ATTACHMENT	vol-754e8a1c	i-bbf3d6d3	/dev/sdh	attaching	2009-12-29T07:25:54+0000


/dev/sda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 00
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/sda2 /mnt ext3 defaults 0 0
/dev/sda3 swap swap defaults 0 0


-bash-3.1# mount
/dev/sda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/sda2 on /mnt type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sdh on /mnt/ebsimage type ext3 (rw,noatime)

[1] 6276

root      6276  3886  0 02:35 pts/0    00:00:00 dd if /dev/sda1 of /dev/sdh
root      6280  3886  0 02:36 pts/0    00:00:00 grep dd



SNAPSHOT	snap-67b8ce0e	vol-12488c7b	pending	2009-12-29T09:51:23+0000570955437877	10

$ ec2reg -s snap-67b8ce0e -d CentOS54base -n CentOS54
IMAGE	ami-ea9c7183