This is part A of the HPC Cloud session of SURF Research Boot Camp. Here are the topics to be covered:
The User Interface (UI) is the web site that allows you to manage your Virtual Machines (VMs) on the HPC Cloud.
XYZwith the number assigned to you.
Once you login, feel free to explore the menus and tabs offered by the OpenNebula UI. These will offer most of the functionalities a user needs to manage and operate VMs.
It is a good practice to change the initial password provided, to ensure the work environment is yours.
Let’s check whether changing the password worked.
From now on, you can use your new password to log in to the UI. Please login again.
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.
~/.ssh/directory. Check with the command
ls ~/.ssh; you should see the files
Next, you need to copy the public SSH key (
id_rsa.pub) to the UI. The matching private key (
id_rsa) remains safe in your laptop.
cat ~/.ssh/id_rsa.pub, then selecting and copying all the text).
Working with the HPC Cloud service mostly revolves around building and destroying VMs. This section will teach how to build a VM running Linux with the following steps:
imagewith a Linux operating system installed.
templateto run your first VM.
Let’s create your first VM to be run on the HPC Cloud Oort!
SURFsara HPC Cloud provides ready-made
appliances to their users. These appliances are available in the
Apps option of the Storage menu in the HPC Cloud UI. This is meant to help users instantiating secure VMs quickly. Proceed as follows:
applianceUbuntu-16.04.4-Server (2018-04-01) by clicking on the tick-box next to it.
Food for brain:
- When you click on an
appliance(anywhere on the row except for the tick-box), you can see detailed information about the
appliance. Can you see the information about the
appliancewe are using in this exercise?
- When you import an
templateare created as explained during the introductory presentation. You can verify that the process is complete by inspecting the Images section in the Storage tab, and the VMs section in the Templates tab. You should see your new image and template there.
- Can you see them?
- What is the Status of the
imagejust after you import it?
- Refresh the images list until the Status is READY.
template file consists of a set of attributes that define a Virtual Machine. For example, you can define how many cores you want your VM to have, how much RAM memory, what storage drives to attach, which network connections, etc. To get a general overview of the attributes that define a VM, proceed as follows:
templatecreated previously and check the tick-box.
templateinspection mode. For your reference, if any changes would need to be made to the
templatefile (e.g. increasing the amount of CPUs), you would click on the green button Update instead.
When an appliance is imported from the Apps , the disk image is normally non-persistent (
persistency=no). In simple words, image persistency is a property that controlls whether changes to the image are kept (
persistency = yes) or not (
persistency = no) when you shutdown the VM. Follow the next steps to make your
imageyou created before Course Image (with exception of the tick-box).
As mentioned earlier, 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:
templateattributes, 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:
templategives your VM the shape you want. A
templateis just a recipe; not the machine itself.
appliancesendorsed by SURFsara HPC Cloud team that you can use.
Your VM will appear in the list of virtual machines. At first, it will have the state
PENDING. 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 associated
template. Keep refreshing the list by clicking button . When the required capacity becomes available, your VM will show the status
RUNNING. Only then 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). For windows users, a terminal can be started from the MobaXterm toolbox.
Type the following command on the terminal to establish a connection with your VM:
Replace 145.100.5X.YZT with your IP address!
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. Type Yes, in that case.
You should now see a similar line in your terminal:
This means that you have logged in successfully to your Virtual Machine!
ubuntu@145...:~$ ls ~ ubuntu@145...:~$ whoami
ubuntu@145...:~$ echo "Some text ..." > myfile ubuntu@145...:~$ cat myfile
ctrl-Din your terminal (do not issue any shutdown command):
Food for brain:
Log in to your VM again. Is your file still there?
Let’s shutdown your VM. Whenever you do not need your VM running, 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
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.
This section is meant as extra questions that we thought would be nice for you to investigate, and we invite you to do/think about them even after the workshop is 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!!!
Before you move to the next sections, remember to shut your VMs down.