Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed firewall zoning, simplified options, noted minor EUMETSAT differences and added a section on user ids

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 it a directory via NFS from the one machine with that volume mounted.

Provisioning the VMs

Tip

If running the VMS at ECMWF, make Make sure both server and client have the 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 to see how to set it up.

...

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


    No Format
    sudo yum install nfs-utils

    On Ubuntu


  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/255.255.255.024(rw,sync,no_root_squash,no_all_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 enable those services to be open. 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=publictrusted --add-service=nfssource=192.168.1.0/24
    sudo firewall-cmd --permanent --zone=public --add-service=mountd
    sudo firewall-cmd --permanent --zone=public --add-service=rpc-bind
    sudo firewall-cmd --reload


  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


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 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


Using the nfs share

When you use an NFS share across multiple machines, the machines need to agree on the identity of the users in order to properly support permissions, otherwise you will see a lot of "permission denied" difficulties.

This is normally accomplished by using a numeric id that every user and group has (type id on a console to see yours) - this numeric id must be the same between the server and all clients.  This can be accomplished manually (i.e. creating/altering user ids to match on all machines) or automatically (e.g. using networked authentication such as LDAP, which normally comes pre-installed on EUMETSAT tenants).

If security within the tenant is not a concern, you can simply use the root account to open permissions fully (chmod -R a+rwX DIRECTORY) or change ownership (see chown command).  You can also add "squash_all" to the export options in /etc/exports to force all operations to happen as if they were owned by the "nobody" user, effectively granting everyone complete access.

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

...

Page properties
hiddentrue


Related issues