Instance Operations
Creating a key
To be able to ssh into instances, you need to generate a key:
ec2-add-keypair mykey >mykey.private # mykey is the logical name, mykey.private is a filename containing your private key. chmod 0600 mykey.private # to see if it's working ec2-describe-keypairs
Selecting an image
To see available images of VMs, kernels and ramdisks use
ec2-describe-images
This will give you a list of all available machine images that you could run.
If you only want to see virtual machines, just filter the output
ec2-describe-images |grep emi
Running an instance
Ok, so you have chosen the VM image and want to create an instance
ec2-run-instances emi-<ID> -k <YOURKEY> -n <NUMBER_OF_INSTANCES> -t <TYPE> --addressing private
Here <ID> is the code of the image you have selected, <YOURKEY> is the logical name of the keypair you want to use, <NUMBER_OF_INSTANCES> is the number of VMs you want to create. <TYPE> is the VM type. And as we don't provide public IPs at the moment, add --addressing private, otherwise it will fail, complaining the it has no free IPs. e.g.
ec2-run-instances emi-E6E51488 -k mykey -n 1 --addressing private
To see the status:
ec2-describe-instances
Typically it takes 1-3 minutes to get machine running.
Types:
- m1.small: 1core, 512MB RAM, 7GB Disk
- c1.medium: 1core, 1024MB RAM, 10GB Disk
- m1.large: 2 cores, 2038MM RAM, 15GB Disk
- m1.xlarge: 4 cores, 3911MB RAM, 20GB Disk
- c1.xlarge: 8 cores, 7822MB RAM, 30GB Disk
Managing an instance
ec2-terminate-instances <INSTANCE ID1> <INSTANCE ID2 > ... ec2-reboot-instances <INSTANCE ID1> <INSTANCE ID2 > ...
SSH into an running instance
Generally, the procedure is as follows:
ssh -i mykey.private root@<accessible-instance-ip>
However, due to some technical problems, we are forwarding ssh port (and http port) to the tawaki machine ports. The machines receive IPs from the internal network 10.0.0.0/255.255.0.0. So to calculate what are the ports for your machine:
TBD