Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added ubuntu nfs kernel package

Block devices can only be mounted on one machine at a time. If you need to share some storage space across multiple VMs, you can export a directory via NFS from the machine with that volume mounted.

Info

For EUMETSAT EWC side you should have a look at SFS EUMETSAT - Shared File System (SFS) usage in tenants.


Provisioning the VMs

Tip

Make sure both server and client have a private network enabled, in order to see each other.  Do not enable NFS on a public/internet interface!

You may want to also set up an extra volume other than the root one to use as the export. See Creating storage volumes Adding extra disk storage to your instances to see how to set it up.

Installing and configuring the NFS server

  1. Install the NFS server and tools if not installed. On CentOS:


    No Format
    sudo yum install nfs-utils

    On Ubuntu:

    No Format
    sudo apt install nfs-kernel-server


  2. Configure the directory or directories to export. For example, if you want to share a directory called /data within your private tenant network (here, we assume it's 192.168.1.0/24)

    No Format
    echo "/data 192.168.1.0/24(rw,sync,no_root_squash)" | sudo tee -a /etc/exports

    You may want to adapt it to suit your needs.

  3. Start the services. On CentOS:

    No Format
    sudo systemctl enable rpcbind
    sudo systemctl enable nfs-server
    sudo systemctl enable nfs-lock
    sudo systemctl enable nfs-idmap
    sudo systemctl start rpcbind
    sudo systemctl start nfs-server
    sudo systemctl start nfs-lock
    sudo systemctl start nfs-idmap

    On Ubuntu:

    No Format
    sudo service nfs-kernel-server restart


  4. You may need to configure the firewall to recognise your private network IP range (here assumed to be 192.168.1.0/24 ) as trusted, enabling access to the NFS server.  On CentOS:

    No Format
    sudo firewall-cmd --permanent --zone=trusted --add-source=192.168.1.0/24
    sudo firewall-cmd --reload


    Warning
    Do not enable NFS on a public / internet-facing interface!


  5. Take note of the private IP of the server, as you will need it when configuring the clients.  On the EUMETSAT part of EWC, you can also use the name of the machine, but the IP will work too.

    No Format
    ip addr show


Tip
titleEUMETSAT: Creating new Security Group for NFS server

If your VM runs on the EUMETSAT cloud, you will need to use a special security group. NFS uses 111 (UDP and TCP) and 2049 (TCP and UDP) ports for communicating through the network, which are not open by default in EUMETSAT configuration. In order to allow connections coming from the network to those ports, you need to create a new security group and set rules. Our "Creating Security Groups in Morpheus" knowledge base article covers the details regarding the task and you can follow it to create your own rule to allow NFS connections. After creating the new security group for NFS, you need to change the NFS Server's current security group to your new rule. 

Installing and configuring the NFS clients

...

  1. Create the directory where the mount is going to go. We are using /data in this example:

    No Format
    sudo mkdir /data


  2. Add an entry to your /etc/fstab. In this basic example we assume our server is on 192.168.1.1:

    No Format
    echo "192.168.1.1:/data /data nfs defaults 0 0" | sudo tee -a /etc/fstab > /dev/null

    You may add extra options to your entry.

  3. The shared filesystem will be automatically mounted on the next reboot. To mount it straight away, you may run:

    No Format
    sudo mount -av


...

Content by Label
showLabelsfalse
max5
spacesEWCLOUDKB
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel in ("volume","disk","storage","nfs") and type = "page" and space = "EWCLOUDKB"
labelsstorage volume disk nfs

...