Tutorials/CloudSim/administration

CloudSim administration ==

This tutorial describes how to:
 * Login to a CloudSim instance.
 * Add/remove users.
 * Change Amazon Web Services (AWS) credentials.

Important: you must determine the proper availability zone to run CloudSim.

Introduction ===

CloudSim runs in a dedicated Cloud Instance, and it is reachable via a public URL. CloudSim requires users to have a Google gmail account to log in. However, CloudSim is not open to just anybody. Only the users in the CloudSim's user list are allowed to log in to a running instance of CloudSim.

Log in to CloudSim ===

Point your browser to the CloudSim instance. You should land on the login page.Following the login link should bring you to the OpenID page where you can choose the provider. At this time, only Google is supported.



Once you have entered your credentials at Google, you should be redirected to the Console page.



This is the CloudSim console. It shows
 * The CloudSim logo on the top left corner
 * The logged in user, logout link and settings link on the top right corner
 * The constellation provisioning widget
 * The list of running constellations.
 * The CloudSim version information

CloudSim is capable of launching multiple machines that work together during a single simulation session. For example, you might want one machine to run the simulator and another machine to provide computing resources for the control systems that you're going to test in simulation. CloudSim uses the term "constellation" to describe such a collection of networked machines that are running together in the cloud. In CloudSim, all machines exist within the context of a constellation, so for example, if you launch a single simulator, it will be alone in its own constellation.

Add users === For adding users or modifying your AWS credentials, access the settings page by clicking on the Settings link in the top right corner.

Users with administrative privileges can perform the following additional tasks: add / remove users and change the AWS credentials.



To Add a user, type in a valid Google email address in the text box, select the type of user from the drop down menu (user or admin), and press the "Add user" button.

To remove a user, press the "X" button next to the user name.

You may need to reload the page to see the effect of user additions and removals.

Override the AWS credentials === For adding users or modifying your AWS credentials, access the settings page by clicking on the settings link on the top right corner.

This feature allows users with administrative privileges to set new AWS credentials. By default, the AWS credentials used to launch CloudSim will be used by CloudSim to launch other machines.

Because of AWS internal details, certain constellations can only be launched from specific availability zone. You can therefore specify which availability zone should be used for each region (or let AWS choose one for you, by specifying any).

Just type in the new credentials and press the "override" button. This will check the credentials against AWS before accepting new ones.



Important notes:
 * Overriding credentials affects all new constellations operations. Any new constellation launches will be performed using the new credentials, and billed to the corresponding AWS user. However, it does not affect running constellations. When terminating constellations, CloudSim uses a copy of the credentials that were used to launch it.
 * Overriding the credentials has no effect on the CloudSim machine itself, and it continues running under its current account.

Determining the proper availability zone === The only way to determine the proper availability zone is to try to launch a constellation and use the error messages to guide you. Unfortunately, this may require a trial and error approach. Make sure you have your key and secret keys at hand. If you are using the wrong availability zone, you should get one of these errors: See the troubleshooting tutorial.
 * Subnet error: subnets can only be created in the following availability zones: ...
 * Unsupported VPC error: please retry your request using availability zone xxx

SSH access to the CloudSim machine ===

Users with administrative privileges can connect to the CloudSim instance via ssh.

'''Most users do not need to ssh to the CloudSim machine. This capability is used mainly by developers or for debugging problems.'''

Download the ssh key by following the "SSH key download" link at the top right of the screen. This downloads a zip file that contains the ssh key (key-xxx.pem) and a script to connect to the machine (ssh-cs.bash).



After downloading the file, unzip it, e.g.: unzip ~/Downloads/cloudsim_ssh.zip

To ssh to the CloudSim machine, use the convenience script `ssh-cs.bash` that's included in the .zip file, e.g.:

# Your directory name will be different (cs_XXXXXXXXXX) ./cs_cc3397c94e/ssh-cs.bash

You'll be logged in as the `ubuntu` user. This user has password-less `sudo` access (so be careful!).

Once you're logged into your CloudSim machine, some files of note include:


 * The file that contains the users (in a JSON format) is:

/var/www-cloudsim-auth/users


 * Also, the Amazon keys are stored here:

/var/www-cloudsim-auth/boto.ini

Other things you can do include:


 * Use the Redis database to inspect or get rid of CloudSim state. Start by running the `redis-cli` tool, and listing all keys in the database (for more `redis-cli` commands, see the command reference), e.g.:

ubuntu@ip-10-144-148-108:~$ redis-cli redis 127.0.0.1:6379> keys * 1) "cloudsim_ready"       2) "cloudsim_config" 3) "cloudsim_configuration_list"


 * Get key files for all machines. They are stored in:

/var/www-cloudsim-auth/machines

Other administrative privileges ===

Users with administrative privileges also have an extending list of constellation types they can launch. For example, it is possible to launch another CloudSim instance (using the current AWS credentials, and the current user as administrator).

How to stop CloudSim ===

When you're done using CloudSim you can terminate it via your AWS Console, as you would terminate any other EC2 machine. Note that CloudSim runs on a `micro` instance, which is free for most AWS users. So it's probably OK to leave your CloudSim instance running even when you're not using it.

Warning: Before terminating a CloudSim instance, be sure to use the CloudSim interface to terminate all machines that were launched via CloudSim. Otherwise, you could lose track of launched machines, leading to unexpected EC2 usage charges.

Next ====

Next: Launch/terminate constellations in the cloud