In this lab, you will:

Prerequisites

Goal:

We will deploy the Virtual Machine via the Exoscale UI. Therefore, open the Exoscale Console and Log In with your credentials.

Create an SSH Key

You might want to be able to access your Virtual Machine after it is provisioned. Therefore, we need to preccreate an SSH Key which can be used to access this machine.

This SSH Key has to be created on your machine. On Linux, Mac or WSL machines, this should work as follows:

The public part of the SSH Keypair has to be stored in Exoscale to make it usable in Virtual Machines. Therefore, select "Compute" -> "SSH-Keys" -> "Add", assign a name you remember to the key and paste the public part.

Provision the Virtual Machine

With this, we should have everything we need to provision a virtual machine.

img/virt-exo-terraform-intro-instance.png

Adding a Security Group

To add the security group, select "Security Groups" in the "Compute" menu:

Access the Virtual Machine via SSH

In our lab, we want to install software and therefore, it is beneficial to have shell access. Now it's time to remember where you stored the private ssh key. When you found it, open up your shell and execute:

You will find out that you are not able to connect to the machine. This is due to a missing security group.

Run the following commands to install containerd on the virtual machine:

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get -yy install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Now, we want to run a container on our virtual machine. Therefore, we will use the docker run command. This command will pull the container image from the docker hub and run it on our machine.

docker run hello-world