DSS How to export a container via NFS to your virtual machine in LRZ
This guide describes the steps you need to take in order to mount a DSS container into your VM. We demonstrate the procedure on a LRZ Compute Cloud VM with MWN floating ip.
Prerequisites
Data in your DSS containers follow POSIX user group semantics which means there is a unique user identifier (UID) for the user and unique group identifier (GID) who owns the data. To expose DSS container data via NFSv3 to external systems, those need to use the same UIDs and GIDs. Otherwise data access will not be permitted by the NFS server. As data curator or container manger you can obtain the UIDs and GIDs of the invited users of the container with the following dsscli
command. If your user has an unprivileged invitation to the container, please ask your data curator to perform this step.
(dsscli) dss passwd list --containername <container-name> ab12cd:x:<UID>:<GID>::/home/ab12cd: ef34gh:x:<UID>:<GID>::/home/ef34gh:
The output has the structure username:TODO:UID:GID
. With this information we can continue to prepare our VM, which is described in the next section.
Virtual Machine Preparation
Login to your machine and create a new group.
sudo groupadd --gid <GID> <container-name>
Next we create a new user with the right group membership and same UID as your DSS Container user. The command will prompt you to fill in user information and password.
sudo adduser --home /home/myuser --uid <UID> --ingroup <container-name> myuser
- On Debian-based distros install the
nfs-common
package on RedHat-based distros installnfs-utils
package. - Make sure your VM has a IP inside Müncher Wissenschafts Netz (MWN). In case you are using a LRZ's Compute Cloud instance make sure you assign a floating IP from MWN pool.
Create a directory which will be used to mount the NFS container volume. We suggest you name it after your DSS Container.
sudo mkdir -p /dss/<container-name>
DSS Container NFS Export Creation
Note that you need to be data curator or container manager in order to be able to perform this.
Option 1 through DSSWeb
Login to DSSWeb and navigate to the DSS Container you want to expose data via NFS. Scroll down until you see the NFS Export section. Click on + create new export
and provide the form data.
You can configure the Client IP Address
(your VM MWN floating IP), how long your export should be available with the expires date
input and the access mode
which can be read only
or read and write
. After hitting the create button you will be redirected to the DSS Container detail view.
You should see a new line in the NFS Export section with a spinner, indicating the ongoing creation of the export. After the spinner cleared the export is ready. Copy the Mount Path
field from the export entry, it is used to mount the volume into your VM in the last section.
Option 2 through dsscli
Login to dsscli.dss.lrz.de through ssh and create a new NFS export. If the command does not fail it shows a new NFS Export with status CREATE PENDING.
(dsscli) dss nfsexport create --containername <container> --ip <mwn-ip> --accessmode <READ_WRITE | READ_ONLY> --expires <date-time> +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | ID | <some-id> | | Container | <container>. | | IP | <mwn-ip>. | | Access Mode | <READ_WRITE | READ_ONLY> | | Status | CREATE PENDING | | Active Task | <some-task-id> | | Expires At | <date-time> | +-------------+--------------------------------------+
You can view your NFS Export with the following command. If its status is CREATED, the export is ready.
(dsscli) dss nfsexport show <some-id> +-------------+-----------------------------------------------------------+ | Field | Value | +-------------+-----------------------------------------------------------+ | ID | <some-id> | | Container | <container-name> | | IP | <mwn-ip> | | Access Mode | <READ_WRITE | READ_ONLY> | | Status | ACTIVE | | Mount Path | <mount-path> | | Expires | <date-time> | | Active Task | None | | Created | <created-timestamp> | | Last Update | <update-timestamp> | +-------------+-----------------------------------------------------------+
Mount NFS Volume on Virtual Machine
To mount the DSS container volume issue the following command on your VM as root. Use <mount-path>
from either option.
mount -t nfs -o rsize=1048576,wsize=1048576,hard,tcp,bg,timeo=600,vers=3 <mount-path> /dss/<container-name>
The mount is not durable across VM reboots. You can create a fstab entry and configure the automounter utility to enable the OS to mount your volume during automatically during boot. The following guide describes the necessary steps.
In order to access the mounted NFS volume, you now need to change user to one of the user accounts your created in the preparation step 1 above.
sudo su - myuser cd /dss/<contianer-name>