DEPRECATED
Check Julia 2 documentation instead!
OpenStack Introduction
Login
- Go to https://julia.uni-wuerzburg.de
- Use your JMU account credentials
- Use domain: julia
Launch a virtual machine
- Go to:
Project->Compute->Instances - Click: "Launch Instance"
Virtual machine setup
In order to start a virtual machine, you have to fill out the required fields in the following whizzard. These fields are marked with an asterisk (*).
Details
- Give your machine an
Instance Namelike: myProjectName. With that name, you can later easily identify your machine in the list of all running machines. - Define the number of machines, you want to create. The default
Countis 1.
Source
You will be given a list of operating systems. We provide operating system images ending with the "-Julia" suffix, like
- Ubuntu16.04-Julia
- Ubuntu18.04-Julia
- Debian9-Julia
Select your operating system by clicking on the "Up" arrow button.
Flavor
Now you can select the properties of your machine like numbers of CPU cores and memory. These properties are defined as flavors.
| Name | RAM | VCPUs |
|---|---|---|
| tiny | 4096 | 2 |
| small | 8192 | 4 |
| medium | 16384 | 8 |
| large | 184320 | 16 |
| xlarge | 368640 | 32 |
Some other flavors are special:
| Name | RAM | VCPUs | Comment |
|---|---|---|---|
| gpu.large | 180000 | 16 | Will spawn on a GPU node with one dedicated GPU accelerator card |
| fat.huge | 1024000 | 72 | Will spawn on a FAT node and provide up to 1TB of RAM |
Select your flavor by clicking on the "Up" arrow button.
Key Pair
In order to login to your machine after sucessfully launching the virtual machine, you have to provide an SSH public key. If not done already, you can either upload the public key from your local machine or create a new one. Otherwise just select one of your uploaded public keys.
Access to your machine
You can access your virtual machine via an special IP address, known as Floating IP.
On the Compute -> Instances page find your machine and click on "Associate Floating IP" in the dropdown menu on the right side of the webpage.
In the following whizzard you can select your favorite Floating IP from the dropdown menu.
If the list of available IPs is empty, feel free to click on the "Plus" button to request additional IPs. You can then select the new requested IP in the dropdown menu.
As you can see, the Floating IPs are in the range from 10.106.241.1 to 10.106.250.254. These private IP addresses are routet inside of the univerity network. If you are at home or are using some other WLAN except RZUWsec, you may need a VPN connection to connect to the university network first.
Login via SSH
Now you are able to login via SSH to your machine by using the Floating IP, you selected. e.g.
$ ssh debian@10.106.241.65
Linux myprojectname 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
Welcome to Julia Computing Environment
debian@myprojectname:~$
For our provided operating systems the default user for Ubuntu based systesms is ubuntu and debian for Debian based systems.
Install your software environment
You can use sudo to gain administrative rights in order to install software and configure your virtual machine:
debian@myprojectname:~$ sudo su -
myprojectname debian $ whoami
root
myprojectname debian $
Finalizing your virtual machine
Create a snapshot
After finishing the installation of your software environment you should shutdown your machine. Create a snapshot afterwards by using "Create Snapshot" in the dropdown menu on the instances overview page and give the snapshot a meaningfull name.
The snapshot can be used to spawn new virtual machines with that exact image of your software environment.
Select "Snapshot" in the dropdown menu in the "Source" window of the "Create Instance" whizzard and select your snapshot from that list.
Important
Takeing a snapshot takes a while. The OpenStack Storage part is optimized for spawning a lot of images at the same time and, while they are running, to take care of the virtual disk I/O. Creating a snapshot is therefore a background job and OpenStack will schedule this task for you. This may take up to one day. Do not try to delete the virtual machine while the machine is in scheduled snapshot creation state.
Delete your virtual machine
Make sure you delete your virtual machine after usage. Machines which are in shutdown state will still lock the required ressources. Other colleagues may want to use the ressources too.
Custom Startup Scripts
When launching an new instance, you can provide a script in order to customize your instance via cloud-init at startup.
Place your script in the "Configuration" tab in the "Launch Instance" whizzard.
Set a user password
You can set a password for the default ubuntu oder debian user at startup.
#cloud-config
chpasswd:
list: |
ubuntu:set_your_password_here
root:set_your_root_password_here
expire: False
Important
Because of the format (YAML) of the script be careful with the leading spaces. Use two spaces for each indentation level.
Setting up an graphical environment
You can run ssh -X to your machine and execute any graphical binary, but in some cases this might not be sufficient enough.
We do not recommend the console in the openstack dashboard since it is not meant for productive usage.
Example: Setting up an VNC server
Log in to your virtual machine and install the required software. In this exmaple, we use Ubuntu 18.04 as operating system.
Choose your desktop environment
We do not provide an default desktop environment, so you can choose your own.
In this example we will use XFCE, since it's small in size and dependencies and sufficient enough for most use cases.
Let's install XFCE:
ubuntu@xserver-test:~$ sudo apt-get update
[...]
ubuntu@xserver-test:~$ sudo apt-get -y install xfce4 xfce4-goodies
Set up your VNC server
We prefer thightvncserver:
ubuntu@xserver-test:~$ sudo apt install tightvncserver
Run the vncserver for the first time.
ubuntu@xserver-test:~$ vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is xserver-test:1
Creating default startup script /home/ubuntu/.vnc/xstartup
Starting applications specified in /home/ubuntu/.vnc/xstartup
Log file is /home/ubuntu/.vnc/xserver-test:1.log
The password must be between six and eight characters long. Passwords more than 8 characters will be truncated automatically.
Once you verify the password, you'll have the option to create a a view-only password. Users who log in with the view-only password will not be able to control the VNC instance with their mouse or keyboard. This is a helpful option if you want to demonstrate something to other people using your VNC server, but this isn't required.
You can later change the password later with vncpasswd.
When VNC is first set up, it launches a default server instance on port 5901. This port is called a display port, and is referred to by VNC as :1. VNC can launch multiple instances on other display ports, like :2, :3, and so on.
You can determine the display port from the output of your vncserver at startup:
New 'X' desktop is xserver-test:1
In this case VNC is running on display port :1.
Stop the VNC server for now:
ubuntu@xserver-test:~$ vncserver -kill :1
Configure the VNC server
We want to start an XFCE environment when we launch the VNC server. Therefore we change the startup script for the VNC server.
Edit your ~/.vnc/xstartup file and change it to:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
Startup the VNC server again, but this time maybe with a higher screen resolution. In this case: 1400x900.
ubuntu@xserver-test:~$ vncserver -geometry 1400x900
Connecting to your VNC session
Since VNC connections are not encrypted we recommend to use a ssh session as transport layer and tunnel the VNC session.
From your local computer start a ssh tunnel:
ssh -L 5901:127.0.0.1:5901 -C -N ubuntu@10.106.241.XXX
In this case we're binding port 5901 of the remote connection to port 5901 on your local machine. The -C switch enables compression, while the -N switch tells ssh that we don't want to execute a remote command. Replace the XXX with your assigned floating IP-address.
Now you can run any VNC viewer on your local computer and point it to localhost:5901 or :1. We are using vinagre as VNC viewer.
$ vinagre :1 &