Hi, since a few months we're running a new infrastructure, with the core built on GPFS (4.1.0.8), for 'light source - X-Rays' experiments local at the site. The system is used for the data acquisition chain, data analysis, data exports and archive. Right now we got new detector types (homebuilt, experimental) generating millions of small files - the last run produced ~9 million files at 64 to 128K in size ;-). In our setup, the files gets copied to a (user accessible) GPFS instance which controls the access by NFSv4 ACLs (only !) and from time to time, we had to modify these ACLs (add/remove user/group etc.). Doing a (non policy-run based) simple approach, changing 9 million files requires ~200 hours to run - which we consider not really a good option. Running mmgetacl/mmputacl whithin a policy-run will clearly speed that up - but the biggest time consuming operations are the get and put ACL ops. Is anybody aware of any faster ACL access operation (whithin the policy-run) - or even a 'mod-acl' operation ? best regards, Martin
On 28/07/15 17:28, Martin Gasthuber wrote:
Hi,
since a few months we're running a new infrastructure, with the core built on GPFS (4.1.0.8), for 'light source - X-Rays' experiments local at the site. The system is used for the data acquisition chain, data analysis, data exports and archive. Right now we got new detector types (homebuilt, experimental) generating millions of small files - the last run produced ~9 million files at 64 to 128K in size ;-). In our setup, the files gets copied to a (user accessible) GPFS instance which controls the access by NFSv4 ACLs (only !) and from time to time, we had to modify these ACLs (add/remove user/group etc.). Doing a (non policy-run based) simple approach, changing 9 million files requires ~200 hours to run - which we consider not really a good option. Running mmgetacl/mmputacl whithin a policy-run will clearly speed that up - but the biggest time consuming operations are the get and put ACL ops. Is anybody aware of any faster ACL access operation (whithin the policy-run) - or even a 'mod-acl' operation ?
In the past IBM have said that their expectations are that the ACL's are set via Windows on remote workstations and not from the command line on the GPFS servers themselves!!! Crazy I know. There really needs to be a mm version of the NFSv4 setfacl/nfs4_getfacl commands that ideally makes use of the fast inode traversal features to make things better. In the past I wrote some C code that set specific ACL's on files. This however was to deal with migrating files onto a system and needed to set initial ACL's and didn't make use of the fast traversal features and is completely unpolished. A good starting point would probably be the FreeBSD setfacl/getfacl tools, that at least was my plan but I have never gotten around to it. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
On Tue, 28 Jul 2015 at 12:28 -0000, Martin Gasthuber wrote:
In our setup, the files gets copied to a (user accessible) GPFS instance which controls the access by NFSv4 ACLs (only !) and from time to time, we had to modify these ACLs (add/remove user/group etc.). Doing a (non policy-run based) simple approach, changing 9 million files requires ~200 hours to run - which we consider not really a good option.
Just a thought, but instead of applying the ACLs to the files individually, could you apply the ACLs on a few parent directories instead? There are certainly issues to consider (current directory structure, actual security model, any write permissions, etc), but this might simplify things considerably. Stuart -- I've never been lost; I was once bewildered for three days, but never lost! -- Daniel Boone
Reality check on GPFS ACLs. I think it would be helpful to understand how ACLs are implemented in GPFS - - All ACLs for a file sytem are stored as records in a special file. - Each inode that has an ACL (more than just the classic Posix mode bits) has a non-NULL offset to the governing ACL in the special acl file. - Yes, inodes with identical ACLs will have the same ACL offset value. Hence in many (most?) use cases, the ACL file can be relatively small - it's size is proportional to the number of unique ACLs, not the number of files. And how and what mmapplypolicy can do for you - mmapplypolicy can rapidly scan the directories and inodes of a file system. This scanning bypasses most locking regimes and takes advantage of both parallel processing and streaming full tracks of inodes. So it is good at finding files (inodes) that satifsy criteria that can be described by an SQL expression over the attributes stored in the inode. BUT to change the attributes of any particular file we must use APIs and code that respect all required locks, log changes, etc, etc. Those changes can be "driven" by the execution phase of mmapplypolicy, in parallel - but overheads are significantly higher per file, than during the scanning phases of operation. NOW to the problem at hand. It might be possible to improve ACL updates somewhat by writing a command that processes multiple files at once, still using the same APIs used by the mmputacl command. Hmmm.... it wouldn't be very hard for GPFS development team to modify the mmputacl command to accept a list of files... I see that the Linux command setfacl does accept multiple files in its argument list. Finally and not officially supported nor promised nor especially efficient .... try getAcl() as a GPFS SQL policy function.
Hi Marc, your description of the ACL implementation looks like each file has some sort of reference to the ACL - so multiple files could reference the same physical ACL data. In our case, we need to set a large number of files (and directories) to the same ACL (content) - could we take any benefit from these 'pseudo' referencing nature ? i.e. set ACL contents once and the job is done ;-). It looks that mmputacl can only access the ACL data 'through' a filename and not 'directly' - we just need the 'dirty' way ;-) best regards, Martin
On 3 Aug, 2015, at 19:05, Marc A Kaplan <makaplan@us.ibm.com> wrote:
Reality check on GPFS ACLs.
I think it would be helpful to understand how ACLs are implemented in GPFS -
- All ACLs for a file sytem are stored as records in a special file. - Each inode that has an ACL (more than just the classic Posix mode bits) has a non-NULL offset to the governing ACL in the special acl file. - Yes, inodes with identical ACLs will have the same ACL offset value. Hence in many (most?) use cases, the ACL file can be relatively small - it's size is proportional to the number of unique ACLs, not the number of files.
And how and what mmapplypolicy can do for you -
mmapplypolicy can rapidly scan the directories and inodes of a file system. This scanning bypasses most locking regimes and takes advantage of both parallel processing and streaming full tracks of inodes. So it is good at finding files (inodes) that satifsy criteria that can be described by an SQL expression over the attributes stored in the inode.
BUT to change the attributes of any particular file we must use APIs and code that respect all required locks, log changes, etc, etc.
Those changes can be "driven" by the execution phase of mmapplypolicy, in parallel - but overheads are significantly higher per file, than during the scanning phases of operation.
NOW to the problem at hand. It might be possible to improve ACL updates somewhat by writing a command that processes multiple files at once, still using the same APIs used by the mmputacl command.
Hmmm.... it wouldn't be very hard for GPFS development team to modify the mmputacl command to accept a list of files... I see that the Linux command setfacl does accept multiple files in its argument list.
Finally and not officially supported nor promised nor especially efficient .... try getAcl() as a GPFS SQL policy function._______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
You asked: "your description of the ACL implementation looks like each file has some sort of reference to the ACL - so multiple files could reference the same physical ACL data. In our case, we need to set a large number of files (and directories) to the same ACL (content) - could we take any benefit from these 'pseudo' referencing nature ? i.e. set ACL contents once and the job is done ;-). It looks that mmputacl can only access the ACL data 'through' a filename and not 'directly' - we just need the 'dirty' way ;-) " Perhaps one could hack/patch that - but I can't recommend it. Would you routinely hack/patch the GPFS metadata that comprises a directory? Consider replicated and logged metadata ... Consider you've corrupted the hash table of all ACL values...
Hi Marc, this was meant to be more a joke than a 'wish' - but it would be interesting for us (with the case of several millions of files having the same ACL) if there are ways/plans to treat ACLs more referenced from each of these files and having a mechanism to treat all of them in a single operation. -- Martin
On 7 Aug, 2015, at 23:21, Marc A Kaplan <makaplan@us.ibm.com> wrote:
You asked:
"your description of the ACL implementation looks like each file has some sort of reference to the ACL - so multiple files could reference the same physical ACL data. In our case, we need to set a large number of files (and directories) to the same ACL (content) - could we take any benefit from these 'pseudo' referencing nature ? i.e. set ACL contents once and the job is done ;-). It looks that mmputacl can only access the ACL data 'through' a filename and not 'directly' - we just need the 'dirty' way ;-)"
Perhaps one could hack/patch that - but I can't recommend it. Would you routinely hack/patch the GPFS metadata that comprises a directory? Consider replicated and logged metadata ... Consider you've corrupted the hash table of all ACL values...
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
We (myself and a few other GPFS people) are reading this and considering... Of course we can't promise anything here. I can see some ways to improve and make easier the job of finding and changing the ACLs of many files. But I think whatever we end up doing will still be, at best, a matter of changing every inode, rather than changing on ACL that all those inodes happen to point to. IOW, as a lower bound, we're talking at least as much overhead as doing chmod on the chosen files.
The mmfind command/script you may find in samples/ilm of 4.1.1 (July 2015) is completely revamped and immensely improved compared to any previous mmfind script you may have seen shipped in an older samples/ilm/mmfind. If you have a classic "find" job that you'd like to easily parallelize, give the new mmfind a shot and let us know how you make out!
Hi Marc, maybe a stupid question - is it expected that the 4.1.1 mmfind set of tools also works on a 4.1.0.8 environment ? -- Martin
On 11 Aug, 2015, at 21:45, Marc A Kaplan <makaplan@us.ibm.com> wrote:
The mmfind command/script you may find in samples/ilm of 4.1.1 (July 2015) is completely revamped and immensely improved compared to any previous mmfind script you may have seen shipped in an older samples/ilm/mmfind.
If you have a classic "find" job that you'd like to easily parallelize, give the new mmfind a shot and let us know how you make out!
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
mmfind in 4.1.1 depends on some new functionality added to mmapplypolicy in 4.1.1. Depending which find predicates you happen to use, the new functions in mmapplypolicy will be invoked (or not.) If you'd like to try it out - go ahead - it either works or it doesn't. If it doesn't you can also try using the new mmapplypolicy script and the new tsapolicy binary on the old GPFS system. BUT of course that's not supported. AFAIK, nothing bad will happen, but it's not supported. mmfind in 4.1.1 ships as a "sample", so it is not completely supported, but we will take bug reports and constructive criticism seriously, when you run it on a GPFS cluster that has been completely upgraded to 4.1.1. (Please don't complain that it does not work on a back level system.) For testing this kind of functionality, GPFS can be run on a single node or VM. You can emulate an NSD volume by "giving" mmcrnsd a GB sized file (or larger) instead of a block device. (Also not supported and not very swift but it works.) So there's no need to even "provision" a disk. --marc of GPFS
On 11/08/15 19:11, James Davis wrote:
If trying the naive approach, a la find /fs ... -exec changeMyACL {} \; or /usr/lpp/mmfs/samples/ilm/mmfind /fs ... -exec changeMyACL {} \; #shameless plug for my mmfind tool, available in the latest release of GPFS. See the associated README. I think the cost will be prohibitive. I believe a relatively strong internal lock is required to do ACL changes, and consequently I think the performance of modifying the ACL on a bunch of files will be painful at best.
I am not sure what it is like in 4.x but up to 3.5 the mmputacl was some sort of abomination of a command. It could only set the ACL for a single file and if you wanted to edit rather than set you had to call mmgetacl first, manipulate the text file output and then feed that into mmputacl. So if you need to set the ACL's on a directory hierarchy over loads of files then mmputacl is going to be exec'd potentially millions of times, which is a massive overhead just there. If only because mmputacl is a ksh wrapper around tsputacl. Execution time doing this was god dam awful. So I instead wrote a simple C program that used the ntfw library call and the gpfs API to set the ACL's it was way way faster. Of course I was setting a very limited number of different ACL's that where required to support a handful of Samba share types after the data had been copied onto a GPFS file system. As I said previously what is needed is an "mm" version of the FreeBSD setfacl command http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1) That has the -R/--recursive option of the Linux setfacl command which uses the fast inode scanning GPFS API. You want to be able to type something like mmsetfacl -mR g:www:rpaRc::allow foo What you don't want to be doing is calling the abomination of a command that is mmputacl. Frankly whoever is responsible for that command needs taking out the back and given a good kicking. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
On Linux you are free to use setfacl and getfacl commands on GPFS files. Works for me. As you say, at least you can avoid the overhead of shell interpretation and forking and whatnot for each file. Or use the APIs, see /usr/include/sys/acl.h. May need to install libacl-devel package and co.
On 11/08/15 23:11, Marc A Kaplan wrote:
On Linux you are free to use setfacl and getfacl commands on GPFS files. Works for me.
Really, for NFSv4 ACL's? Given the RichACL kernel patches are only carried by SuSE I somewhat doubt that you can. http://www.bestbits.at/richacl/ People what to set NFSv4 ACL's on GPFS because when used with vfs_gpfs you can get Windows server/NTFS like rich permissions on your Windows SMB clients. You don't get that with Posix ACL's. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
On GPFS-Linux-Redhat commands getfacl and setfacl DO seem to work fine for me. nfs4_getfacl and nfs4_setfacl ... NOT so much ... actually, today not at all, at least not for me ;-( [root@n2 ~]# setfacl -m u:wsawdon:r-x /mak/sil/x [root@n2 ~]# echo $? 0 [root@n2 ~]# getfacl /mak/sil/x getfacl: Removing leading '/' from absolute path names # file: mak/sil/x # owner: root # group: root user::--- user:makaplan:rwx user:wsawdon:r-x group::--- mask::rwx other::--- [root@n2 ~]# nfs4_getfacl /mak/sil/x Operation to request attribute not supported. [root@n2 ~]# echo $? 1
I thought acls could either be posix or nfd4, but not both. Set when creating the file-system? Simon ________________________________________ From: gpfsug-discuss-bounces@gpfsug.org [gpfsug-discuss-bounces@gpfsug.org] on behalf of Marc A Kaplan [makaplan@us.ibm.com] Sent: 12 August 2015 15:43 To: gpfsug main discussion list Subject: Re: [gpfsug-discuss] fast ACL alter solution On GPFS-Linux-Redhat commands getfacl and setfacl DO seem to work fine for me. nfs4_getfacl and nfs4_setfacl ... NOT so much ... actually, today not at all, at least not for me ;-( [root@n2 ~]# setfacl -m u:wsawdon:r-x /mak/sil/x [root@n2 ~]# echo $? 0 [root@n2 ~]# getfacl /mak/sil/x getfacl: Removing leading '/' from absolute path names # file: mak/sil/x # owner: root # group: root user::--- user:makaplan:rwx user:wsawdon:r-x group::--- mask::rwx other::--- [root@n2 ~]# nfs4_getfacl /mak/sil/x Operation to request attribute not supported. [root@n2 ~]# echo $? 1
On Wed, 2015-08-12 at 14:49 +0000, Simon Thompson (Research Computing - IT Services) wrote:
I thought acls could either be posix or nfd4, but not both. Set when creating the file-system?
The options for ACL's on GPFS are POSIX, NFSv4, all which is mixed NFSv4/POSIX and finally Samba. The first two are self explanatory. The mixed mode is best given a wide berth in my opinion. The fourth is well lets say "undocumented" last time I checked. You can set it, and it shows up when you query the file system but what it does I can only speculate. Take a look at the Korn shell of mmchfs if you doubt it exists. Try it out on a test file system with mmchfs -k samba My guess though I have never verified it, is that it changes the schematics of the NFSv4 ACL's to more closely match those of NTFS ACL's. A bit like some of the other GPFS settings you can fiddle with to make GPFS behave more like an NTFS file system. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
On Wed, 2015-08-12 at 10:43 -0400, Marc A Kaplan wrote:
On GPFS-Linux-Redhat commands getfacl and setfacl DO seem to work fine for me.
Yes they do, but they only set POSIX ACL's, and well most people are wanting to set NFSv4 ACL's so the getfacl and setfacl commands are of no use.
nfs4_getfacl and nfs4_setfacl ... NOT so much ... actually, today not at all, at least not for me ;-(
Yep they only work against an NFSv4 mounted file system with NFSv4 ACL's. So if you NFSv4 exported a GPFS file system from an AIX node and mounted it on a Linux node that would work for you. It might also work if you NFSv4 exported a GPFS file system using the userspace ganesha NFS server with an appropriate VFS backend for GPFS and mounted on Linux https://github.com/nfs-ganesha/nfs-ganesha However last time I checked such a GPFS VFS backend for ganesha was still under development. The RichACL stuff might also in theory work except it is not in mainline kernels and there is certainly no advertised support by IBM for GPFS using it. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
On 11/08/15 21:56, Jonathan Buzzard wrote: [SNIP]
As I said previously what is needed is an "mm" version of the FreeBSD setfacl command
http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1)
That has the -R/--recursive option of the Linux setfacl command which uses the fast inode scanning GPFS API.
You want to be able to type something like
mmsetfacl -mR g:www:rpaRc::allow foo
What you don't want to be doing is calling the abomination of a command that is mmputacl. Frankly whoever is responsible for that command needs taking out the back and given a good kicking.
A further three years down the line and setting NFSv4 ACL's on the Linux command line is still as painful as it was back in 2011. So I again have a requirement to set NFSv4 ACL's server side :-( Futher, unfortunately somewhere in the last six years I lost my C code to do this :-( In the process of redoing it I have been looking at the source code for the Linux NFSv4 ACL tools. I think that with minimal modification they can be ported to GPFS. So far I have hacked up nfs4_getfacl to work, and it should not be too much extra effort to hack up nfs_setfacl as well. However I have a some questions. Firstly what's the purpose of a special flag to indicate that it is smbd setting the ACL? Does this tie in with the undocumented "mmchfs -k samba" feature? Second there is a whole bunch of stuff about v4.1 ACL's. How does one trigger that. All I seem to be able to do is get POSIX and v4 ACL's. Do you get v4.1 ACL's if you set the file system to "Samba" ACL's? Note in the longer term it I think it would be better to modify FreeBSD's setfacl/getfacl (say renamed to mmsetfacl and mmgetfacl) to do the job, on the basis that they handle both POSIX and NFSv4 ACL's in a single command. Perhaps a RFE? JAB. -- Jonathan A. Buzzard Tel: +44141-5483420 HPC System Administrator, ARCHIE-WeSt. University of Strathclyde, John Anderson Building, Glasgow. G4 0NG
participants (7)
-
James Davis -
Jonathan Buzzard -
Jonathan Buzzard -
Marc A Kaplan -
Martin Gasthuber -
Simon Thompson (Research Computing - IT Services) -
Stuart Barkley
