How to export a volume over NFS outside of a project

Prerequisites

No. 1 Hosting

You need a Destination Earth hosting account with Horizon interface https://cloud.central.data.destination-earth.eu.

No. 2 Linux VM running cloud

Instructions for creating and accessing a Linux VM using default images can be found here:

How to create a Linux VM and access it from Linux command line or here:

How to create a Linux VM and access it from Windows desktop.

The instructions included in this article are designed for Ubuntu 22.04 LTS. Let the name of one instance be host and other to be client.

No. 3 Basic knowledge of the Linux terminal

You will need basic knowledge of the Linux command line.

No. 4 SSH access to the VM

How to connect to your virtual machine via SSH in Linux.

In this article, we shall act as user called eouser in VM console and how to reach it, is explained here:

How to access the VM from OpenStack console.

The starting position

Assuming you have done all that is required in these prerequisites, in this article we will use two instances of Ubuntu 22.04:

Host: 217.71.193.205
Client: 217.71.193.209

This is what you should see in Horizon:

../../../../_images/imag_011.png

On both servers, we will create a directory /xdata, which will be shared.

Step 1 Create /xdata on host

Here are the commands to update Ubuntu, install NFS kernel server, create /xdata, assign it a user called nobody from nogroup and then mark for export via a file in /etc/folder:

eouser@host:~$ sudo apt-get update
eouser@host:~$ sudo apt-get install nfs-kernel-server
eouser@host:~$ sudo mkdir /xdata
eouser@host:~$ sudo chown nobody:nogroup /xdata
eouser@host:~$ sudo nano /etc/exports

Add the line:

/xdata 64.225.128.2(rw,sync,no_subtree_check)

Save the file.

Start the server:

eouser@host:~$ sudo systemctl restart nfs-kernel-server

For Ubuntu 22.04 start the server with this command:

eouser@host:~$ sudo service nfs-kernel-server start

Now go to:

Create new security group. Give it a name (eg. allow_nfs) and save by clicking “Create security group” button. Click “manage rules”. Click “add rule” Choose: Rule: Custom TCP Rule

Direction: Ingress Openport: Port Port: 2049 Remote: CIDR CIDR: 64.225.128.2

Click “Add”. Now go to:

From the drop-down menu on the right of the “Host” instance, choose “Edit Security Groups”

Click on the “plus” sign on the “allow_nfs” group. This will move the group from “All Security Groups” to “Instance Security Groups”. Click “Save”.

On the Client

eouser@client:~$ sudo apt-get update
eouser@client:~$ sudo apt-get install nfs-common
eouser@client:~$ sudo mkdir /xdata
eouser@client:~$ sudo mount 64.225.128.1:/xdata /xdata

You can check if the directory is mounted:

eouser@client:~$ df -h