This project is generously supported by Fractus. There is a single account that is shared among all the CS6410 students. This means that the instructions here will not be sufficient to stand up a fractus cluster from scratch, but they will develop familiarity with many elements of this process.
Note: Fractus is behind the firewall of the CS Department. You need to use the Cisco VPN to access the machines. After installation, use the following settings to connect:
Academic Integrity applies to all aspects of this course. Because we will all be sharing a single Fractus account, it will be possible (with some effort) to decrypt and read other students' Fractus machine image files, or to steal their static content files. This is not fundamentally different from the bad old days when CS programming projects were done on a batch computing system and printouts were delivered in sorted piles in public terminal rooms. The University's Academic Integrity Policy applies to everything we put into Fractus, and you are expected to follow this policy scrupulously.
Because there is a single shared account for this course, we must adhere to certain conventions to ensure that different students' projects do not interfere with each other. Our conventions are as follows:
.pem
format.
This nominally "secret" information must be known by every CS6410 student in order to use the shared account. It is not provided in this (public) document; instead, it is available for download from CMS. Effectively, we are relying on CMS authentication to restrict the Fractus account information to registered CS6410 students.
Whenever you are actively using a Fractus instance, you must mark this in our shared document. The link for the document can be found in CMS. Because we have a limited shared budget to use Fractus, we don't want idle instances to be running and using the shared budget. It is your responsibility to stop the instance after use. However, as a backup plan we ask you to mark the document, so that the TA can regularly check whether instances not being used are still running. Instances running without being marked as being in use in the shared document can be stopped without prior notice.
Some Fractus resources are in either global or Fractus-account-wide name spaces. We have defined naming conventions for these resources. Here are the conventions regarding the Fractus compute service:
Virtual Machine Image: A machine image is a static file on disk that contains (at least) a bootable root partition. In this class, we will use the same machine image to create virtual machine instances. The image we will use is emi-F528A6E4. The EMI name is ubuntu-12-04-ebs and the root device is of type EBS.
Instance Name Prefixes: These should be chosen to be unique by including your netid and then appending whatever descriptive name you want according to the pattern:
vm-netid-descriptionfor example:
Choose keypair names using the pattern:
kp-netid-descriptionfor example:
Security groups are similiar. Choose group names using the pattern:
gp-netid-description
To help things work smoothly with so many users sharing the same Fractus account, we ask you to adhere scrupulously to the above conventions.
To get the shared Eucalyptus account information, log on to CMS, go to
mp0, and download the file account-info.txt
and the zip
file authentication.zip
. Open account-info.txt
in
a text editor and follow the instructions you see there. At the conclusion,
you should be able to run:
$echo EC2_CERT
This code should produce an absolute path to a Base64 encoded DER
certificate (a .pem
file). Output should match the
documentation in the file.
Documenting the enviornment setup is one of the most important parts of being able to reproduce an experiment. We will be installing euca2ools version 3.x. Instructions can be found here. Regardless of which installation method you use, be sure that supporting utilities (such as git, pip, or gzip) are installed first.
As per our convention, you should use a netid-specific name following our naming conventions; for example,
kp-netid-xxxwhere the netid part should be replaced by your own netid, and xxx is a suffix that helps you identify the key. In order to log in to your instance, you will have to call ssh with a flag that takes the name of this file as an argument. Therefore, put it someplace where you can find it. For example:
$ euca-create-keypair kp-ks2232-test > ~/.euca/fractus/id-rsa-kp-ks2232-test
$ chmod 600 ~/.euca/fractus/id-rsa-kp-ks2232-test
Again, the name you use for this file is arbitrary, but you need some
convention that will enable you to remember the name of the private key
file associated with each of your Eucalyptus keypair names. SSH has been
noted to refuse using public keys unless the file permissions are set
appropriately (on UNIX, the command
$ chmod 600 ~/.euca/fractus/id-rsa-kp-ks2232-test
should do
the trick). To debug your ssh connections, use the -v or -vv flag.
If euca-create-keypair
returns the error "No ec2
endpoint given...
", this means that your environment was
disturbed. You can fix this by rerunning
$ source ~/.euca/fractus/eucarc
, which you
should have originally run when following the instructions in
account-info.txt
.
The Network Security Group is another important issue that is not well covered in the Eucalyptus documentation. Every Eucalyptus instance runs in a named security group that you specify when you start the instance. The security group has a set of firewall rules that control network connectivity between instances within the group and instances outside it.
If you start an instance without explicitly specifying a security group, the instance runs in a predefined group named "default". Clearly, it would be a Bad Idea for concurrent users of a shared account to have instances running in the (same) default security group; so we use the naming convention described above for security groups. You should create a new security group for the remainder of this exercise using a command like
$ euca-create-group gp-netid-xxx -d
"yyyyyyyy"
As above, you should replace netid by your own netid, xxx by a string to make the security group name unique among all the security group names you define, and yyyyyyy by a short description of this security group as in the following:
$ euca-create-group gp-ks2232-test -d
"test group for getting started"
You can check that the group you created exists using the command:
Alternatively, you can use this command to list all groups that have been defined by anyone using the shared account:
It is now time to start our instance. The command is as follows:
$ euca-run-instances emi-F528A6E4 -g
gp-ks2232-test -k kp-ks2232-test -z fractus
This command starts an instance in the specified group
gp-ks2232-test. The Eucalyptus Machine Image used in the example is
called emi-F528A6E4
. For a complete list of available
images, you can run the euca-describe-images
command. In general we will provide you with an image that
contains all the libraries required for the mini-project assignments
-- emi-F528A6E4 is one such image and you can use this image for the
current mini-project.
Before you actually start the instance, please mark the instance
as started in the shared document (link provided on CMS.
In the next step, "Authorizing Network Access," you need to specify your group name in order to adjust its firewall rules:
$ euca-authorize gp-ks2232-test -P tcp -p 22 -s 0.0.0.0/0
$ euca-authorize gp-ks2232-test -P tcp -p 80 -s 0.0.0.0/0
This opens the standard TCP ports from any address (0.0.0.0/0) for ssh (22) and HTTP (80) in the group gp-ks2232-test.
At this point, you should be able to connect to your instance via
the ssh command. Again, this command uses the name of the RSA
private key file you saved when you created your Eucalyptus keypair,
and the external network address assigned to your running instance.
To identify your instance, run
$ euca-describe-instances
to find the addresses
indicated by .xx.xx in the example below:
$ ssh -i ~/.euca/fractus/id-rsa-kp-ks2232-test root@128.84.xx.xx
Congratulations! You have started and connected to an instance! However, we are not finished.
DO NOT go away without remembering to shut down your instance -- the CS6410 course account is charged for the instance for as long as it continues to run.
Don't leave any Eucalyptus instances running!The command
$ euca-describe-instances --filter key-name=kp-netid-xxx
will show you a list all running instances using your key. You can
then stop them by running $
euca-stop-instances i-nnnnn ...
You don't have to submit anything. After the deadline, we will check if you have created the keypair, security group, and VM instance successfully. Make sure to leave your work correctly named with your NetID.
At this point, this subproject is complete. Once again, this was only a peek into the Eucalyptus API. For a more thorough breakdown of the API, installation, or associated guides, please go HERE. Let it be noted, these documents refer to a more current version of Eucalyptus than is installed on our Fractus cluster. Nevertheless, these documents can be of some use to interested students.