Please make sure NFSv4 ID Mapping value matches on client and server
(e.g. test.com; may vary on your setup).

server:

mmnfs config change IDMAPD_DOMAIN=test.com

client:

e.g. RHEL NFS client; set Domain attribute in /etc/idmapd.conf file and restart idmap service.
# egrep ^Domain /etc/idmapd.conf
Domain = test.com
# service nfs-idmap restart


reference Link:

https://www.ibm.com/support/knowledgecenter/en/STXKQY_5.0.0/com.ibm.spectrum.scale.v5r00.doc/b1ladm_authconsidfornfsv4access.htm

Thanks,
Chetan.


Inactive hide details for "Wilson, Neil" ---06/18/2018 09:35:55 PM---I think it’s caused by the ID mapping not being configure"Wilson, Neil" ---06/18/2018 09:35:55 PM---I think it’s caused by the ID mapping not being configured properly. Found this on the redhat knowle

From: "Wilson, Neil" <neil.wilson@metoffice.gov.uk>
To: gpfsug main discussion list <gpfsug-discuss@spectrumscale.org>
Date: 06/18/2018 09:35 PM
Subject: Re: [gpfsug-discuss] CES-NFS: UID and GID resolution
Sent by: gpfsug-discuss-bounces@spectrumscale.org





I think it’s caused by the ID mapping not being configured properly.
Found this on the redhat knowledge base.

Environment

IssueRaw
nss_getpwnam: name 'root@example.com' does not map into domain 'localdomain'
ResolutionRaw
Domain = example.comRaw
# service rpcidmapd restart
# mount -o remount /nfs/mnt/point

NOTE: It is only necessary to restart rpc.idmapd service on systems where rpc.idmapd is actually performing the id mapping. On RHEL 6.3 and newer NFS CLIENTS, the maps are stored in the kernel keyring and the id mapping itself is performed by the /sbin/nfsidmap program. On older NFS CLIENTS (RHEL 6.2 and older) as well as on all NFS SERVERS running RHEL, the id mapping is performed by rpc.idmapd.

Raw
# nfsidmap -c

NOTE: The above command is only necessary on systems that use the keyring-based id mapper, i.e. NFS CLIENTS running RHEL 6.3 and higher. On RHEL 6.2 and older NFS CLIENTS as well as all NFS SERVERS running RHEL, the cache should be cleared out when rpc.idmapd is restarted.

Disabling idmapping

NOTE: In order to properly disable idmapping, it must be disabled on both the NFS client and NFS server.
- By default, RHEL6.3 and newer NFS clients and servers disable idmapping when utilizing the AUTH_SYS/UNIX authentication flavor by enabling the following booleans:

Raw
NFS client
# echo 'Y' > /sys/module/nfs/parameters/nfs4_disable_idmapping

NFS server
# echo 'Y' > /sys/module/nfsd/parameters/nfs4_disable_idmapping

Raw
# cat /sys/module/nfs/parameters/nfs4_disable_idmapping
Y
# umount /mnt
# mount rhel6u6-node2:/exports/nfs4 /mnt
# grep -A 5 rhel6u6-node2 /proc/self/mountstats | egrep '(rhel6u6-node2|caps:)'
device rhel6u6-node2:/exports/nfs4 mounted on /mnt with fstype nfs4 statvers=1.0
caps: caps=0xffff,wtmult=512,dtsize=32768,bsize=0,namlen=255
^Raw
[root@rhel6u3-node1 ~]# echo N > /sys/module/nfs/parameters/nfs4_disable_idmapping
[root@rhel6u3-node1 ~]# umount /mnt
[root@rhel6u3-node1 ~]# mount rhel6u6-node2:/exports/nfs4 /mnt
[root@rhel6u3-node1 ~]# grep -A 5 rhel6u6-node2 /proc/self/mountstats | egrep '(rhel6u6-node2|caps:)'
device rhel6u6-node2:/exports/nfs4 mounted on /mnt with fstype nfs4 statvers=1.0
caps: caps=0x7fff,wtmult=512,dtsize=32768,bsize=0,namlen=255
^

NOTE: To force ONLY numeric IDs to be used on the client, add RPCIDMAPDARGS="-C" to the etc/sysconfig/nfs file and restart the rpcidmapd service. See man rpc.idmapd for more information.

NOTE: This option can only be used with AUTH_SYS/UNIX authentication flavors, if you wish to use something like Kerberos, idmapping must be used.

Root Cause

NFS_CAP_UIDGID_NOMAP bitRaw
#define NFS_CAP_UIDGID_NOMAP (1U << 15)

static int nfs4_init_server(struct nfs_server *server,
const struct nfs_parsed_mount_data *data)
{
struct rpc_timeout timeparms;
int error;

dprintk("--> nfs4_init_server()\n");

nfs_init_timeout_values(&timeparms, data->nfs_server.protocol,
data->timeo, data->retrans);

/* Initialise the client representation from the mount data */
server->flags = data->flags;
server->caps |= NFS_CAP_ATOMIC_OPEN|NFS_CAP_CHANGE_ATTR|NFS_CAP_POSIX_LOCK;
if (!(data->flags & NFS_MOUNT_NORDIRPLUS))
server->caps |= NFS_CAP_READDIRPLUS;
server->options = data->options;

/* Get a client record */
error = nfs4_set_client(server,
data->nfs_server.hostname,
(const struct sockaddr *)&data->nfs_server.address,
data->nfs_server.addrlen,
data->client_address,
data->auth_flavors[0],
data->nfs_server.protocol,
&timeparms,
data->minorversion);
if (error < 0)
goto error;

/*
* Don't use NFS uid/gid mapping if we're using AUTH_SYS or lower
* authentication.
*/
if (nfs4_disable_idmapping && data->auth_flavors[0] == RPC_AUTH_UNIX) <--- set a flag based on the module parameter
server->caps |= NFS_CAP_UIDGID_NOMAP; <-------------------------- flag set

if (data->rsize)
server->rsize = nfs_block_size(data->rsize, NULL);
if (data->wsize)
server->wsize = nfs_block_size(data->wsize, NULL);

server->acregmin = data->acregmin * HZ;
server->acregmax = data->acregmax * HZ;
server->acdirmin = data->acdirmin * HZ;
server->acdirmax = data->acdirmax * HZ;

server->port = data->nfs_server.port;

error = nfs_init_server_rpcclient(server, &timeparms, data->auth_flavors[0]);

error:
/* Done */
dprintk("<-- nfs4_init_server() = %d\n", error);
return error;
}Raw
int nfs_map_uid_to_name(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
{
struct idmap *idmap = server->nfs_client->cl_idmap;
int ret = -EINVAL;

if (!(server->caps & NFS_CAP_UIDGID_NOMAP)) { <------------ CHECK FLAG, DECIDE whether to call idmapper
ret = nfs_idmap_lookup_name(uid, "user", buf, buflen);
if (ret < 0)
ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf);
}
if (ret < 0)
ret = nfs_map_numeric_to_string(uid, buf, buflen);
return ret;
}
int nfs_map_gid_to_group(const struct nfs_server *server, __u32 gid, char *buf, size_t buflen)
{
struct idmap *idmap = server->nfs_client->cl_idmap;
int ret = -EINVAL;

if (!(server->caps & NFS_CAP_UIDGID_NOMAP)) { <------------ CHECK FLAG, DECIDE whether to call idmapper
ret = nfs_idmap_lookup_name(gid, "group", buf, buflen);
if (ret < 0)
ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, gid, buf);
}
if (ret < 0)
ret = nfs_map_numeric_to_string(gid, buf, buflen);
return ret;
}
"fs/nfs/idmap.c" 872L, 21804CDiagnostic StepsRaw
RPCIDMAPDARGS="-vvv"Raw
Jun 3 20:22:08 node1 rpc.idmapd[1874]: nss_getpwnam: name 'root@example.com' does not map into domain 'localdomain'
Jun 3 20:25:44 node1 rpc.idmapd[1874]: nss_getpwnam: name 'root@example.com' does not map into domain 'localdomain'Raw
# tcpdump -s0 -i {INTERFACE} host {NFS.SERVER.IP} -w /tmp/{casenumber}-$(hostname)-$(date +"%Y-%m-%d-%H-%M-%S").pcap & Raw
NFS4ERR_BADOWNER = 10039,/* owner translation bad */

NFS4ERR_BADOWNER An owner, owner_group, or ACL attribute value
can not be translated to local representation.


Hope this helps.

Neil Wilson Senior IT Practitioner
Storage, Virtualisation and Mainframe Team IT Services
Met Office FitzRoy Road Exeter Devon EX1 3PB United Kingdom

From: gpfsug-discuss-bounces@spectrumscale.org <gpfsug-discuss-bounces@spectrumscale.org> On Behalf Of Oesterlin, Robert
Sent:
18 June 2018 16:54
To:
gpfsug main discussion list <gpfsug-discuss@spectrumscale.org>
Subject:
[gpfsug-discuss] CES-NFS: UID and GID resolution

Can anyone tell me why I’m not seeing the correct UID/GID resolution from CES? Configured with LDAP authentication, and this appears to work correctly.

On my CES cluster (V4):

[robert_oesterlin@unv-oester robert_oesterlin]$ ls -l
total 3
-rw-r--r-- 1 nobody nobody 15 Jun 18 11:40 junk1
-rw-r--r-- 1 nobody nobody 4 Oct 9 2016 junk.file
-rw-r--r-- 1 nobody nobody 1 May 24 10:44 test1

On my CNFS cluster (V3)

[root@unv-oester2 robert_oesterlin]# ls -l
total 0
-rw-r--r-- 1 robert_oesterlin users 15 Jun 18 11:40 junk1
-rw-r--r-- 1 robert_oesterlin users 4 Oct 9 2016 junk.file
-rw-r--r-- 1 robert_oesterlin users 1 May 24 10:44 test1


Bob Oesterlin
Sr Principal Storage Engineer, Nuance
_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss