How to export a volume over NFS (outside of a project)?
This article presumes use of two Ubuntu or derivative system machines located in different projects and not connected via a private network. They both must have floating IPs assigned to them.
For the purpose of this tutorial the machines are:
On both servers we will create directory /xdata which will be shared.
Setting up the host
NFS server must be installed on the host system.
eouser@host:~$ sudo apt-get install nfs-kernel-server eouser@host:~$ sudo mkdir /xdata eouser@host:~$ sudo chown nobody:nogroup /xdata
Following that, edit /etc/exports and add the following line:
Start the server
eouser@host:~$ sudo systemctl restart nfs-kernel-server
Go to the OpenStack Dashboard and to Project>Network>Access and security (https://cf2.cloudferro.com/project/security_groups/).
Create a new security group, give it a name (eg. allow_nfs) and save it by clicking Create security group button. Click manage rules and add rule.
Use the following settings:
Rule: Custom TCP Rule
Switch over to Project>Compute>Instances panel (https://cf2.cloudferro.com/project/instances/).
From the drop-down menu on the right of the host instance, choose Edit Security Groups. Click on the plus icon on the newly created allow_nfs group.
This will move the group from "All Security Groups" to "Instance Security Groups".
Setting up the client
Again, NFS client needs to be installed on the client server; create a mount point and mount the volume.
eouser@client:~$ sudo apt-get install nfs-common eouser@client:~$ sudo mkdir /xdata eouser@client:~$ sudo mount 22.214.171.124:/xdata /xdata
Now check if the directory is mounted:
eouser@client:~$ df -h