Can't add AWS Elastic File Storage NFS mount to webmin

2 posts / 0 new
Last post
#1 Fri, 07/07/2017 - 18:22
h2ojunkie

Can't add AWS Elastic File Storage NFS mount to webmin

In Disk and Network file systems, I've run into an issue saving amazon EFS NFS mounts.

Here's the problem (best I can tell)

Standard mount command for AWS EFS is just a typical NFS mount (example):

/usr/bin/mount -t nfs4 -o nfsvers=4.1 fs-xxxxxxxx.efs.us-west-2.amazonaws.com:/ /import

I'm able to mount the EFS from CLI without any issues.

Webmin Disk and network filesystems can see the mount just fine (see attached):

Screenshot detailing the issues with mount here

However, if i try to "save" the mount in webmin, i get the following error: Failed to save mount : The host 'fs-xxxxxxxx.efs.us-west-2.amazonaws.com' is down

Looking into the script /usr/libexec/webmin/mount/linux-lib.pl around line 1639 I see it's checking the validity of the mount with with showmount and ping.

# check_location(type)
# Parse and check inputs from %in, calling &error() if something is wrong.
# Returns the location string for storing in the fstab file
sub check_location
{
if (($_[0] eq "nfs") || ($_[0] eq "nfs4")) {
local($out, $temp, $mout, $dirlist, @dirlist);

if (&has_command("showmount")) {
# Use ping and showmount to see if the host exists and is up
if ($in{nfs_host} !~ /^\S+$/) {
&error(&text('linux_ehost', $in{'nfs_host'}));
}
$out = &backquote_command("ping -c 1 '$in{nfs_host}' 2>&1");
if ($out =~ /unknown host/) {
&error(&text('linux_ehost2', $in{'nfs_host'}));
}
elsif ($out =~ /100\% packet loss/) {
&error(&text('linux_edown', $in{'nfs_host'}));
}
$out = &backquote_command("showmount -e '$in{nfs_host}' 2>&1");
if ($out =~ /Unable to receive/) {
&error(&text('linux_enfs', $in{'nfs_host'}));
}
elsif ($?) {
&error(&text('linux_elist', $out));
}

The problem - amazon EFS does not respond to showmount or EFS (it appears they block both on their end and no way to change that). My best guess is Amazon figures "hey, you made the EFS, you should damn well know what's in it so we're not going to let people probe our EFS system for info"

An additional problem, is webmin doesn't have an option to specify nfsvers=4.1 and it also forces a selection for security method. EFS will fallback to 4.0 compatibility, but 4.1 is preferred. And the security method isn't one recognized by webmin (probably because EFS is a private network system that uses amazons IAM user authentication when mounting from outside of amazon).

So - does anyone have a suggestion as to how I can save this mount in webmin Disk and Network filesystems so that I can easily enable/disable the mount from within webmin when needed? I don't mind creating the initial mount from CLI...but i would really like to be able to save that mount in webmin, and have one click access to enable/disable as needed.

Or is the only solution to get this working is webmin needs a patch to let the user choose to skip the checks?

In the mean time, I'm using init.d to mount..but it would be a lot simpler if i could use disk and network file systems module.

Fri, 07/07/2017 - 19:59
noisemarine

You might want to poke all that into the Issue Tracker so it doesn't get forgotten about or overlooked.

In the meantime, you should be able to create a Custom Command that you can run from with Webmin, if you haven't already.

Topic locked