| 34 | $ ec2-describe-instances |
| 35 | |
| 36 | $ ec2-describe-availability-zones |
| 37 | |
| 38 | $ ec2-describe-keypairs |
| 39 | }}} |
| 40 | * 申請 key pair,以便 ssh 登入 instance |
| 41 | {{{ |
| 42 | $ ec2-add-keypair mykey >mykey.private |
| 43 | ('mykey' is the name for the key in Eucalyptus, 'mykey.private' is the file to be used by ssh) |
| 44 | |
| 45 | $ chmod 0600 mykey.private |
| 46 | |
| 47 | $ ec2-run-instances <emi-id> -k mykey -n <number of instances to start> |
| 48 | }}} |
| 49 | * |
| 50 | {{{ |
| 51 | ### 允許 instance 開啟 22 port ### |
| 52 | $ ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0 |
| 53 | |
| 54 | ### 給予 Instance IP ### |
| 55 | $ ec2-allocate-address |
| 56 | $ ec2-associate-address <IP from allocate> -i <instance ID> |
| 57 | |
| 58 | ### 使用 ssh 登入 ### |
| 59 | $ ssh -i mykey.private root@<accessible-instance-ip> |
| 60 | |
| 61 | ### 關掉 Instances ### |
| 62 | $ ec2-terminate-instances <instance-id1> <instance-id2> ... <instance-idn> |
| 63 | }}} |
| 64 | ---- |
| 65 | = Regerence = |
| 66 | * [http://docs.amazonwebservices.com/AWSEC2/2008-12-01/GettingStartedGuide/ Amazon EC2 Getting Started Guide] |