Page tree
Skip to end of metadata
Go to start of metadata

1. Introduction to science cloud

2. Hands on Part

2.1. Sign up for ScienceCloud

  • Get in touch with contact@s3it.uzh.ch

  • Your account has been activated?

    • Open a web browser and go to https://cloud.s3it.uzh.ch (javascript and cookies must be enabled).

    • Log in with your UZH webpass (the usual shortname and password).

2.2. Get access to your instances

      An SSH key is required to log into your newly created instances: SSH keys have several advantages over regular username/password authentication, but the main reason we use those is that they are really difficult to crack with a brute force approach. SSH keys are made up of two components system: a private key and a public key. The public key resides on the computer/instance you would like to connect to. The private key stays on your own computer. A SSH connection can only be established between a computer having the private key and a computer/instance having the corresponding public key. It's therefore important to never share your private key file.

  • Create a key on Linux/Mac

    The above command will prompt you to set a password to unlock the key. If you accept the default options offerred by ssh-keygen it subsequently generates two files named id_rsa.pub and id_rsa and saves them under /home/<user>/.ssh/

    Note that Ubuntu 16.04 does not support DSA cipher suite for generating the key pair.

    To display the content of the id_rsa.pub file, which is the public half of your key, you can issue:

    Once the generation process is complete there are a few extra steps that needs to be followed:

    1. Log in to https://cloud.s3it.uzh.ch, choose Access & Security.
    2. Go to Keypairs tab, which shows the key pairs that are available for this project.
    3. Select Import Keypair and choose the Keypair Name.
    4. Paste the content of your SSH public key in the Public Key text section

  • Create a keypair on Windows:

    1. Download PuTTYgen from HERE
    2. Open the PuTTYgen program.
    3. For Type of key to generate, select SSH-2 RSA.
    4. Click the Generate button.
    5. Move your mouse in the area below the progress bar. When the progress bar is full, PuTTYgen generates your key pair.
    6. Type a passphrase in the Key passphrase field. Type the same passphrase in the Confirm passphrase field. You can use a key without a passphrase, but this is not recommended.
    7. Click the Save private key button to save the private key.  You must save the private key. 
    8. Right-click in the text field labeled Public key for pasting into OpenSSH authorized_keys file and choose Select All and Copy.
    9. Then:

      1. Log in to https://cloud.s3it.uzh.ch, choose Access & Security.
      2. Keypairs tab, which shows the key pairs that are available for this project.
      3.  Import Keypair.
      4.  Choose the Keypair Name.
      5.  Paste in the Public Key text section the content of your ssh public key.

2.3. Launch an instance

  1. Log in to https://cloud.s3it.uzh.ch.
  2. On the Project tab, open the Compute tab and click Images category.

  3. The dashboard shows three different sets of Images available: Project, Shared With Me, Public.

  4. For the scope of  the training, go to Public and use " Ubuntu 16.04 (2018-07-16) " (A complete list of all supported public images can be found at: http://s3itwiki.uzh.ch/display/clouddoc/Supported+Images)
  5. Click Launch Instance.

  6. In the Launch Instance dialog box, specify the following values:

    1. Instance Name: Assign a name to the virtual machine.
    2. Flavor: Specify the size of the instance to launch.
    3. Instance Count: To launch multiple instances, enter a value greater than 1. The default is 1.
  7. Access & Security tab: Check that your key pair is added to the instance.
  8. Select the networks: To add a network to the instance, click the "+" of uzh-only Network field.
    Congratulation you've just launched your first instance on ScienceCloud

2.4. Login to your instance

  • on Linux/Mac run SSH in terminal

    On usernames

    The convention used for usernames used by the public images on Sciencecloud is straighforward: each distribution has a predefined user with the same name. i.e. Every flavor of Ubuntu has username "ubuntu", Debian distros have "debian", CentOS have "centos" and so on. See http://s3itwiki.uzh.ch/display/clouddoc/Supported+Images for information on what user to use with each image.

  • on Windows
  1. Get the putty.exe from here and run it.
  2. Host Name: username@<instance-IP-address> (Username : 'ubuntu'  if you've chosen Ubuntu for your instance)
  3. Connection type: select SSH.
  4. In the Category pane, expand Connection, expand SSH, and then select Auth.
    1. Click Browse.

    2. Select your private key.ppk file that you generated for your key pair, and then click Open.

    3. (Optional) If you plan to start this session again later, you can save the session information for future use. Select Session in the Category tree, enter a name for the session in Saved Sessions, and then clickSave.

  5. Pressing the ‘Open’ button PuTTY will begin trying to connect you to the instance.
  6. If this is the first time you connect to the instance, PuTTY display a security alert box, click Yes to confirm you trust the host.

2.5. Install packages on a Debian/Ubuntu instance

Steps to install a new software package or upgrade existing software packages on a Debian/Ubuntu system.

  • To update the list of packages known by your system, you can run:

  • To upgrade all the packages on your system (without installing extra packages or removing packages), run:

  • To install a package and all its dependencies on Ubuntu,

  • To remove the package from your system, run:

2.6. Attach a volume to the Instance

  • Create a volume

    1. Log in to https://cloud.s3it.uzh.ch.

    2. On the Project tab, open the Compute tab and click Volumes category.
    3. Volumes tab.
    4. Click Create Volume.
    5. Specify Volume name and Volume Size.
    6. Press Create Volume.

  • Attach Volume

    1. On Volumes tab, select your volume.
    2. From drop-down Edit volume list, select Manage attachments.
    3. From Attach to instance list, choose the instance you wish to attach the volume to.
    4. Press Attach Volume. 

  • Format and mount the volume

    Once a volume is attached to a VM it becomes visible to the operating system but it is in a blank state to make use of it you need to identify it and format it. 

  •  Get the partition list of all your disks and look for entries like vd(LETTER) – where "(LETTER)" is a lowercase latin letter like a, b, etc.


  •  Format your new disk into ext4 (recommended FS)

    This operation has to be performed only once when the volume is attached for the first time otherwise the volume will be completely wiped. 

  • Mount it on your file system


  • Check if it is mounted correctly (there should be a line starting with /dev/vd<LETTER>)

     

  • Set the ownership of mounted volume to allow ubuntu user for read/write

     

2.7. Copy data to your instance

  • On Linux

  • Using Filezilla software

    1. Download Filezilla from https://filezilla-project.org/download.php?show_all=1 and install it.
    2. From File menu select Site Manager. You can also press Ctrl+S or Command+S.

    3. On right panel, select New Site.

    4. On left panel specify the Host: instance IP address.
    5. Port: Only if it differs from the standards.
    6. Protocol: Select SFTP.
    7. Logon Type: choose Key file.
    8. User: The user ID to use when connecting (i.g. ubuntu).
    9. Key file: Browse and select your private key file.

    10. Login using Connect button.
    11. Verify the host key fingerprints.
    12. Drag & drop files from your pc to the instance.

  • Note: If your private key is in .pem format, a new message will pop up to convert your key into .ppk which is supported by Filezilla.

2.8. Snapshot

Snapshots are a feature that allows users to capture the running instance setup and save it without the need to pause or shutdown it. These snapshots are disk-only snapshots.

  • Create a snapshot

    1. Log in to https://cloud.s3it.uzh.ch.
    2. On the Project tab, open the Compute tab and click Instances category.
    3. Select the instance you want to take a snapshot of
    4. Click on Create Snapshot
    5. Snapshot Name: Give the name to your snapshot
    6. Press Create Snapshot
    7. New snapshot is  displayed in the Images category

  • Fit-for-a-purpose-snapshots/images: If you would like to have several pre-configured snapshots or images (i.e. VMs ready for a certain purpose), we encourage you to briefly contact us. We frequently have/had similar cases and may be able to simplify your task.

2.9. Protect your instance

You can prevent accidental instance(s) deletion by "locking" your instance. The relevant option can be found in the dropdown menu right next to your instance name in the Instances page.

Note: If you lock an instance no actions are possible on it. The error messages you will receive when trying are really generic so do remember which instance you lock or try to unlock them

from that same menu in case you notice some unexplicable behaviour.

2.10 Access specific ports on yout VM

 By default the only incoming connections allowed to your VM are via SSH. If you need to access different ports or services running on your VM like a webserver (i.e. open ports 80 and possibly 443) you need to follow these steps:

  • Create security group:
    1. Log in to https://cloud.s3it.uzh.ch
    2. On the Project tab, open the Compute tab and click Access & Security category.
    3. Security Groups tab.
    4. Click Create Security Group.
    5. Choose the Security Group Name, hit Create.
    6. Select Manage rules of your group.
    7. Add rule.
    8. Enter for example port 80 (http)
  • Apply new security group to a running virtual machine:
    1. Log in to https://cloud.s3it.uzh.ch
    2. On the Instances tab, open the drop down menu next to your virtual machine and select Edit Security Group
    3.  Enable the newly created security group by clicking on the + sign next to the security group name
      Note: there is no reason to remove the default security group from your instance but if you decide to do so make sure you have all the rules you need in the newly created one.

3. Further topics:

You can refer to Science Cloud documentation for the further topics such as Associating the floating IP.

To get additional support to ScienceCloud, you can send an email to help@s3it.uzh.ch.

 

 



  • No labels

1 Comment

  1. Feedback from Rostyk

    • add more screenshots
    • add highlights to screenshots
    • screenshots:
      • Launch an instance

      • Create Volume

      • Attach Volume
      • Create a snapshot