Arvutiteaduse instituut
  1. Kursused
  2. 2016/17 kevad
  3. Pilvetehnoloogia alused (MTAT.08.027)
EN
Logi sisse

Pilvetehnoloogia alused 2016/17 kevad

  • Main
  • Lectures
  • Practicals
  • Results
  • Submit Homework

Practice 1 - Starting with cloud

Teaching assistant: Pelle Jakovits (jakovits ät ut . ee) Feel free to send an email if you have any questions about the lab materials or issues with submitting deliverables.

In this practice session you learn how to access cloud services that we will be using in the rest of the course. We will be mainly using a private university cloud (SciCloud) - which is a Cloud infrastructure running on the hardware of the University of Tartu and is managed by the Mobile & Cloud Computing lab. It is divided into separate smaller clouds, built using either Eucalyptus or OpenStack platforms. They are both open source cloud platforms which are fully compatible on the API level with Amazon EC2 public cloud. In this lab we are working on the newer OpenStack cloud platform.

General Information

  • Location of the practice cloud: https://stratus.at.mt.ut.ee/horizon
  • To access the local university cloud services you have to be in the university network. So you either have to use lab computers, eduroam Wifi, or set up a VPN connection to university network.
    • VPN (Estonian) - https://wiki.ut.ee/pages/viewpage.action?pageId=17105590
    • Eduroam Wifi (Estonian) - https://wiki.ut.ee/display/AA/WiFi+ja+eduroam
  • Generating ssh access keypairs for Putty http://www.rackspace.com/knowledge_center/article/generating-rsa-keys-with-ssh-puttygen

Introduction

Working with Iaas model of Cloud usually consists of the following steps:

  1. Register an account to access the cloud services
  2. Select appropriate virtual machine image to run (Ubuntu, Debian, Windows, etc.)
  3. Start a new instance of the selected virtual machine image. Login into the instance as a root user over the internet and configure it to meet your requirements. I.e. install needed software, upload your own application, perform any required configuration actions as you would do in any real computer.
  4. As you will lose all your work when instance will be terminated -- you have three options on how to persist the changes you made:
    1. Save all your configuration steps to a script that will launch and configure the instance automatically for you.
    2. Bundle a new image from your running instance and next time launch your custom image.
    3. Save the running instance as a snapshot, and next time launch new instances from there.

First option is more flexible as you can easily change the script than bundle a new image if something changes. Second and third option are simpler to use once you have stable configuration or when launching large number of instances.

In this lab we are working on the OpenStack cloud platform.

Exercise 1.1. Creating a cloud user account

In this exercise you will create a new account in the OpenStack cloud and use it to request computing resources in a form of a Virtual Machine server.

  1. Go to the lab supervisor and fill a user registration form.
  2. Log into https://stratus.at.mt.ut.ee/horizon
    • You have to be in the university network to access this website. Use VPN or log into eduroam if you're using your own laptop
  3. Download User certificates for EC2 API, which we will be using later.
    • Settings-> Ec2 Credentials -> Download
    • Save these credentials to scicloud folder in your home directory and remember where it is.

Exercise 1.2. - Requesting computing resources from the cloud

  1. Use the OpenStack web interface
  2. Create a new key that you will use to access your instances
    • Under the "Project" tab go to "Access & Security" and create a new keypair
    • Choose a name for this key, should include your last name
    • Download the key file to a location where you'll be able to find it later. Do not lose this key, you will need it to access (ssh) the instances you create.
  3. Under the "Project" tab go to "Instances" and start a new instance by clicking the "Launch Instance" button
    • Select "image" as the source and "Ubuntu 14.04 LTS" as the image.
    • Choose a recognizable name and "praks" as the flavor.
    • Specify what KeyPair that you created earlier.
  4. Your instance should start in a few moments, when it does, click on the name of the instance (same interface where you launched it) and take note of it's "public" IP address. The address starts with 172 and is open to the university network, while the other address is strictly internal and is used for communication between instances inside the cloud.

Exercise 1.3. Accessing your Cloud instance over the internet

  1. Log into your new instance through ssh
    • In Linux:
      • Open command line terminal and use the ssh command
      • ssh -i <local path to key file> ubuntu@<public-ip-address>
      • Example: ssh -i /home/juku/scicloud/key.pem ubuntu@172.17.136.15
    • In Windows:
      • Use Putty, SSH secure Shell or WinSCP program to open a command line interface over the internet
      • We first have to transform the private key file we downloaded from OpenStack into a .ppk file.
        • Start PuTTYgen program
        • Click Load button
        • Browse to the folder where you previously stored the downloaded keypair file (You probably have to change what type of files are displayed in the form as .pem files might not be displayed by default.
        • Select the .pem file and click Open.
        • Click ok and then Save to save the generated .ppk file.
      • Username for the SSH connection has to be ubuntu
        • Specify it in Putty under Connection->Data->Login details
      • Host must be the public IP of the instance you started
      • SSH Key must be the same .ppk key you generated with PyttyKeyGen
        • Specify it's location under: Connection->SSH->Auth->Private key file...

Exercise 1.4. Configuring Firefox plug-in for cloud access

In this exercise you will use a Firefox plugin to access the OpenStack cloud services and to request information about the running instances and available images and snapshots.

  1. Start Firefox browser
  2. New Firefox version no longer supports unsigned addons, so you will have to either use older Firefox version or use Lab computers for this exercise
  3. Download Hybridfox plug-in version 1.6.000237 from: https://code.google.com/archive/p/hybridfox/downloads
  4. Open the downloaded file with Firefox or drag the file into Firefox window
    • If you get a notification about non-signed addon, disable unsigned addon protection for the duration of the lab:
      • https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox?as=u&utm_source=inproduct#w_what-can-i-do-if-firefox-disables-an-installed-add-on
  5. Start the plug-in under Tools->Hybridfox
  6. Configure Regions
    • Region name: SciCloud
    • Type: Openstack
    • Endpoint Url: url of the OpenStack services
      • Open ec2rc.sh file in the scicloud folder. The url you need is the value of EC2_URL
  7. Configure Credentials
    • Account name: your Username
    • AWS Access Key: EC2_ACCESS_KEY value in the ec2rc.sh file
    • AWS secret Key: EC2_SECRET_KEY value in the ec2rc.sh file
    • Preferred Region: SciCloud
  8. Find information about your currently running instance using Hybridfox and make a screenshot for submission.

Exercise 1.5. Accessing your instance through a web command line interface

To simplify the access to the cloud instance you started, we can reconfigure it to allow login using a password and use the OpenStack web console.

  1. Log into your new instance through ssh
  2. change the password of the user ubuntu
    • sudo passwd ubuntu
    • assign a password you can remember.
    • We have to use sudo because normal use of passwd command requires us to enter the current password, which we do not know.
  3. Now the user ubuntu has a password and we can use it to log into the instance through the web console instead of a ssh client.
    • Log into the OpenStack web interface at https://stratus.at.mt.ut.ee/horizon
    • Go to Instances page and click on the name of your instance.
    • Go to the VNC Tab and click on the Click here to show only VNC link.
    • A command line interface should show up in a few moments. Refresh the page if it does not show up.
    • Log into the instance using ubuntu as the username and the password you previously specified.
  4. Make a screenshot of the web command line interface after you have successfully logged in.
  5. After you're done, make sure to terminate your instance using Hybridfox or OpenStack web interface.

Deliverables:

  • Your account has been created in OpenStack.
  • Your instance must have been be terminated!
  • Submit an answer for the following questions:
    • What happens if you lose your ssh KeyPair? What happens to existing instances which were started with the lost ssh key?
    • What are Cloud Volumes? (In the context of OpenStack and other cloud platforms) How can they be useful?
    • Briefly describe 3 advantages of using Virtual Machine instances instead of physical servers.
  • Screenshots created in exercise 1.4 (Hybridfox) and 1.5 (Web command line interface)
    • Pack the screenshots into a single zip file and upload them through the following submission form:


1. Exercise 1
Sellele ülesandele ei saa enam lahendusi esitada.
  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Tartu Ülikooli arvutiteaduse instituudi kursuste läbiviimist toetavad järgmised programmid:
euroopa sotsiaalfondi logo