Overview
Amazon Web Services provide to the user an entire machine, charged per the hour, or reserved and paid by the year. Storage and computation are charged separately. Computation is called EC2, Elastic Cloud Computing, and storage is called EBS, Elastic Block Storage. An EC2 instance is a running computer that you access over the internet, for us, mostly by ssh.
Better than "elastic" computing, it could be called "plastic throw-away" computing. It is easy to set up instances when you need them, and destroy them when you don't need them. Rather than reboot, you reinstall fresh. For that reason, you need to be able to configure a fresh instance programmatically, or else to snapshot your instance and store the snapshot permanently somewhere; to clone additional instances. Most of this is about cloning instances. This isn't so much about having someone supply you one box, it's about scaling to have someone supply you between one and a thousand boxes, growing as your business grows, with very little capital outlays on your part.
In the course, you will create your own instances, and run as root. For now, user accounts have been created for you, using delightfully difficult to remember names of Pokemon characters. Following the usual CS standards, the lead account, in this case pikachu (who else!) can log into any account. It is the grader's account, and that way the grader can help you as well as grade your assignments.
I will talk about how to setup an instance farther down this page. For now, let's just focus on how you will log in.
Logging into our AWS instance.
To log in, you will need three things:
hohokus-2:csc521 burt$ ./ec2ssh.sh pikachu db d88888D j88D db .d888b. .d888b. db dD db db .d888b. o88 VP d8' j8~88 o88 VP `8D 88' `8D o88 d8' o88 o88 VP `8D 88 d8' j8' 88 88 odD' `V8o88' 88 d8' 88 88 odD' 88 d8' V88888D 88 .88' d8' 88 d8888b. 88 88 .88' 88 d8' 88 db 88 j88. d8' db 88 88' `8D db 88 88 j88. VP d8' VP VP VP 888888D d8' VP VP `8888P VP VP VP 888888D /\ __ Hello! The Pokemon have moved | \_____/ / to a new server. Our IP is: / | / ^. ^ | 174.129.16.112 \0 _ 0 | _ _\ _ __| | | TTYL! \/ \ <__| _/ / | __|_/ _/ Your friend Pikachu. | <__|__/ \______/ /__||__\ Connection closed by 75.101.164.86 ------- [root@ip-10-251-43-16 ~]# date Tue Nov 24 11:14:53 EST 2009 [root@ip-10-251-43-16 ~]# uptime 11:14:56 up 36 days, 15:14, 1 user, load average: 0.00, 0.00, 0.00 [root@ip-10-251-43-16 ~]# shutdown -h now Broadcast message from root (pts/0) (Tue Nov 24 11:15:04 2009): The system is going down for system halt NOW! [root@ip-10-251-43-16 ~]# Connection to 75.101.164.86 closed by remote host. Connection to 75.101.164.86 closed. hohokus:csc521 burt$
As of 22 Nov 09, the IP address is 174.129.16.112 (Previous IP: 75.101.164.86)
That takes care of step one.
Warning- the IP address might change every once in a while. I will post the new address here if it does.
I have nothing fancy for the username and pem file. Choose a name from the list below, email me or aravind, and we will send you the pem file.
Usernames:
SSH to account:
Assuming you are vaporeon, and that 174.129.16.112 is the IP address, cd to the directory with the vaporeon.pem file in it, and run:
ssh -i vaporeon.pem vaporeon@174.129.16.112
Transferring files in and out of your account
Use the ftp or the copy functionality of ssh to copy files to and from the instance. You will need to know how to use tar to make archives, so read the man page on tar. In short, it's like this:
Then transfer my_directory.tar. At the destination:tar cvf my_directory.tar my_directory
Use tvf instead of xvf to peek inside a tar file without extracting the contents.tar xvf my_directory.tar
To move files from machine X to machine Y (I'm supposing Y is the aws machine, but whatever you want), on the X machine use:
Sorry about the painful command line syntax. The -o is a sort of quasi-standard for including the options of one program inside another. It means "the sftp option which is to pass to ssh the ssh option named IdentityFile, giving it value vaporeon.pem".sftp -oIdentityFile=vaporeon.pem vaporeon@174.129.16.112
Once connected, there are get, put, ls, cd, and ls and lcd (local ls and local change directory) commands. Also scp can be used with syntax more like cp (no "connection").
As always, consult the man pages. It's all there.
I have mostly talked about having a command line interface to ssh and sftp. I am not as familiar with Windows as I am with unix, but I will try in this section to help with using AWS in the manner described above with a typical Windows client.
The way I find most people using ssh in Windows is by the Putty program. Download the entire package, including PuTTY, puTTYgen, plink, pscp and psftp. At the time of this writing the PuTTY download site has an installer for one-click installation of the PuTTY suite.
PuTTY cannot use .pem files directly. The .pem must be converted to PuTTY's special ppk format. Run PuTTYgen, load the pem file and then save it with the ppk extension. The conversion will be done on save.
The PuTTY graphical tool can be used with the ppk file. Drill down among the options of the PuTTY configuration panel to ssh->keys, and browse for the ppk file. Returning to the session item of the configuration panel, write the IP address and go. When the black terminal window opens, it will ask for the login name, this doesn't seem to be an option to set in the configuration panel.
Plink can be used to run ssh from the command line. It worked but it didn't set the terminal correctly, so it only barely worked. I didn't pursue making that work better. However, psftp worked well. It was invoked at the command line with the same syntax as for unix, -i name-of-key-file.ppk and all.
As for the several other inconveniences (tar, end-of-line character inconsistencies), you have my best wishes and deepest sympathy.
The steps to fully setting up an instance ar: