HOWTO Create a VM on Azure for the ARNEIS project

Introduction

This document details how to create a Virtual Machine on Microsoft Azure cloud that will be used for the ARNEIS project.

Step-by-step instructions

Create a VM using the web interface

  • Login to http://portal.azure.com using your Azure credentials

  • Click on Virtual Machines

  • Click on + Create

  • You will have 2 options: Virtual Machine or Start with a preset configuration

  • We started with Virtual Machine

    image

  • Configure options in section Project details

    • Leave Subscription to Azure Pass - Sponsorship unless you want to charge expenses to someone else

    • Set Resource group to arneis-rg (short for “ARNEIS Resource Group”)

    image

  • Configure options in section Instance details

    • Choose the Virtual machine name as arneis-vm01

    • Select Region (you may leave default “(US) East US” or choose a region which is geographically closer to your clients)

    • In Availability options choose “No infrastructure redundancy required”

    • Leave Security type to “Standard”

    • In field Image select “Ubuntu Server 20.04 LTS - Gen2”

    • In field Size choose “Standard_E2s_v3 - 2 vcpus, 16 GiB memory (EUR 77.57/month)” unless you have different requirements

  • Add your public SSH key if you have one, otherwise let Azure automatically generate one for you

    Result:

    image

  • Review and accept the default values in the following pages: Disks, Networking, Management and Advanced

  • Click Create to start creating the VM

Now you just have to wait for the deployment to complete:

image

Test the VM

After the machine is deployed and started, the IP address assigned to the VM will be displayed on the VM overview page in the Azure portal.

With this information you should be able to remotely log in to the VM via SSH:

ssh -i <private-key-path> azureuser@<vm-public-ip-address>

Then you may run some commands on the shell, for instance:

htop

image

(Recommended) Create a public DNS entry

If you have administrative rights to a DNS zone you may choose to access your VM using a symbolic name rather than an IP address.

If so, access your DNS administrative page (in my case, https://register.it/) and create an A record to map the name to the IP address assigned to your VM.

In my case

A arneis-vm01 20.124.132.35

Wait until the DNS zone is propagated, then verify that the device can be accessed by another host (in our case, our laptop) using the assigned name rather than its IP address:

gmaca@alpha MINGW64 ~
$ ssh -i ~/.ssh/gmacario-gmail-com azureuser@arneis-vm01.gmacario.it
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-1027-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Jan 31 17:52:17 UTC 2022

  System load:  0.0               Processes:             155
  Usage of /:   9.8% of 28.90GB   Users logged in:       1
  Memory usage: 7%                IPv4 address for cni0: 10.42.0.1
  Swap usage:   0%                IPv4 address for eth0: 10.0.0.4

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.


*** System restart required ***
Last login: Mon Jan 31 17:51:47 2022 from 93.43.242.87
azureuser@arneis-vm01:~$

Configure firewall

Logged into https://portal.azure.com/, select Virtual Machine “arneis-vm01”, then in menu “Settings” click Networking.

In tab “Inbound port rules”, click Add inbound port rule, then specify the following:

  • Source: Any

  • Source port ranges: *

  • Destination: Any

  • Service: HTTP

  • Destination port ranges: 80

  • Protocol: TCP

  • Action: Allow

  • Priority: (leave default)

then click Add.

Repeat for the following ports:

  • 443/TCP (HTTPS)

  • 6443/TCP (Kubernetes API Server)

You should obtain the following

image