This is part A of the tutorial UvA HPC course 2021-01-22 and covers the following topics:
The User Interface (UI) is the web site that allows you to manage your Virtual Machines (VMs) on the HPC Cloud.
Login
button.The interface supports several views and for this course, you should use the “user view”.
Once you login to the UI, it is a best practice to change the initial password.
Let’s check whether it worked.
From now on you can use your new password to log in to the UI. Do so now.
To complete the setup of your HPC Cloud account, you need to add a Secure Shell (SSH) public key to your profile. This is a one-time task.
First, you need an SSH private/public key pair.
~/.ssh/
directory. Create one now if needed.ls ~/.ssh
; you should see the files id_rsa
and id_rsa.pub
.Next, you need to copy the public SSH key (id_rsa.pub
) to the UI.
The matching private key (id_rsa
) stays safe in your laptop.
cat ~/.ssh/id_rsa.pub
, then selecting and copying all of that text).ssh-rsa AAAAB
…Using the HPC Cloud revolves around building Virtual Machines (VM). SURF provides several Apps readily available in the HPC Cloud UI, to facilitate creating simple VMs. Apps are ready-made appliances
for you to copy and use.
These are the steps to build your first VM from one of the Apps; detailed instructions follow:
image
with a Linux operating system installed.template
).template
to create your first VM.Let’s run your first VM on the HPC Cloud!
app
Ubuntu-18.04-Desktop by clicking anywhere on that line except the tick-box to the left of it.Food for brain:
When you import an
app
, animage
and atemplate
will be created, as explained during the introductory presentation. In the UI you have an Images tab under Storage and a VMs tab under Templates on the left menu. You should see your newimage
andtemplate
there.
- Can you see them?
- What is the STATUS of the
image
just after you import it?- Refresh the contents of the Images tab page by clicking button , next to the button until it is READY.
A template
consists of a set of attributes that defines a Virtual Machine. For example, how many cores you want your VM to have, how much RAM memory, what storage drives to attach, which network connections, etc. We will have to adapt the template
to meet your requirements before you can use it to create VMs out of it.
Edit the imported template
following these steps:
template
you just imported (Course Template), and click on it (anywhere except the tick-box).nics
) for your VM.NIC 0
on the left pane is mapped to internet
. template
, click the green button Update at the top, to save your changes.A template
is just a description of the virtual machine that we want to build. Let’s create the actual virtual machine from it.
template
, there is only one item in the list. You can see the feedback:template
attributes, for the time being do not change them (leave “Number of instances” at 1).Congratulations! You have just created a fresh, clean virtual machine!
Let’s summarise what you have seen so far. Click on each of the tabs on the left side menu and inspect the information provided. The most important ones at this point in time are described here:
template
gives your VM the shape you want. A template
is just a recipe; not the machine itself.image
.appliances
endorsed by SURFsara HPC Cloud team that you can use.NOTE:
Your VM will appear in the list of virtual machines. At first, it will have the statePENDING
. This indicates that the HPC Cloud is looking for a place where your virtual machine can actually run. Finding the right place depends on the amount of resources (cores, memory, and disk) you requested in the associatedtemplate
. Keep refreshing the list by clicking button . When the required capacity becomes available, your VM will show the statusRUNNING
. Only then can you actually use your VM.
You can interact with your VM in several ways: command-line (e.g.: SSH), VNC (UI in your browser) or a remote desktop. We will use SSH in a terminal for the time being.
The way to log in to your virtual machine is making use of the SSH key pair that you stored in your profile earlier.
Commandline access - SSH
First find your VM’s IP address. It is shown in the IPs column from the virtual machines list on the UI and also in the Network tab of the VM’s details page.
On your laptop, start a terminal (in Mac/Linux) or GitBash (in Windows).
Type the following command on the terminal to establish a connection with your VM:
NOTE:
Replace 145.100.5Q.RST with your IP address! And remember that we know which username to use because we read that on the Description attribute of the app when we were importing it.
ssh ubuntu@145.100.5Q.RST
If everything went well, the first time you try to log in, your terminal will ask you to add the VM’s IP to the list of known hosts in your laptop. Type Yes, in that case.
NOTE:
Right after you reach the newly created VM via SSH for the first time, you may see a prompt asking you to change the default password for user ubuntu. Please, do so by typing first the current password, which is the same as the username. You can then type the password you want. When this password-changing process is finished (even successfully), you may be logged out of the VM. You will then have to submit the SSH command again, and then everything should work as expected: you are connected to a shell in the VM.
You should now see a similar line in your terminal: ubuntu@ip-145...:~$
This means that you have logged in successfully to your Virtual Machine!
ubuntu@ip-145...:~$ ls /
ubuntu@ip-145...:~$ whoami
ubuntu@ip-145...:~$ echo "Some text ..." > myfile
ubuntu@ip-145...:~$ cat myfile
logout
or ctrl-D
in your terminal (do not issue any shutdown command):ubuntu@ip-145...:~$ logout
Food for brain:
Log in to your VM again. Is your file still there?
Let’s shut your first VM down. Anytime you expect your VM to be doing nothing useful, you should shut it down to stop consuming the resources that your VM is holding.
Food for brain:
When the VM has been shut down and disappeared from the list, check and refresh the Storage > Images and Templates > VMs tabs. Are your
image
andtemplate
still there?
This section is meant to propose extra questions we thought would be nice for you to investigate. We invite you to do/think about them even after the workshop has finished.
Bonus: The HPC Cloud has hundreds of users. Many of them have common questions. In order to address these we have put together a web site with some documentation for users. We call it the HPC Cloud Documentation. Do you know the URL of this web site? Make sure you find out!
NOTE:
Your running VMs get exclusive access to their resources whether they are doing something useful or are idle. Because the HPC Cloud is offered on a fair-share basis and other users may actually be needing resources that you may be holding, before you move to the next part of this workshop, please remember to shut all your VMs down.
You completed part A of the Tutorial UvA HPC course 2021-01-22. Please continue with Tutorial Part B.