Mass UID migration suggestions
Hello, We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days. What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup. Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process? Thank you for your time, Luke Storrs-HPC University of Connecticut
Hi Luke, I’ve got an off the wall suggestion for you, which may or may not work depending on whether or not you have any UID conflicts with old and new UIDs … this won’t actually speed things up but it will eliminate the “downtime” for your users. And the big caveat is that there can’t be any UID conflicts … i.e. someone’s new UID can’t be someone else’s old UID. Given that … what if you set an ACL to allow access to both their old and new UIDs … then change their UID to the new UID … then chown the files to the new UID and remove the ACL? More work for you, but no downtime for them. We actually may need to do something similar as we will need to change Windows-assigned UID’s based on SIDs to “correct” UIDs at some point in the future on one of our storage systems. If someone has a better way to solve your problem, I hope they’ll post it to the list, as it may help us as well. HTHAL. Thanks… Kevin On Jun 30, 2017, at 10:20 AM, hpc-luke@uconn.edu<mailto:hpc-luke@uconn.edu> wrote: Hello, We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days. What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup. Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process? Thank you for your time, Luke Storrs-HPC University of Connecticut _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org<http://spectrumscale.org> http://gpfsug.org/mailman/listinfo/gpfsug-discuss — Kevin Buterbaugh - Senior System Administrator Vanderbilt University - Advanced Computing Center for Research and Education Kevin.Buterbaugh@vanderbilt.edu<mailto:Kevin.Buterbaugh@vanderbilt.edu> - (615)875-9633
On 30/06/17 16:20, hpc-luke@uconn.edu wrote:
Hello,
We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days.
What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup.
Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process?
My suggestion is to do some development work in C to write a custom program to do it for you. That way you can hook into the GPFS API to leverage the fast file system scanning API. Take a look at the tsbackup.C file in the samples directory. Obviously this is going to require someone with appropriate coding skills to develop. On the other hand given it is a one off and input is strictly controlled so error checking is a one off, then couple hundred lines C tops. My tip for this would be load the new UID's into a sparse array so you can just use the current UID to index into the array for the new UID, for speeding things up. It burns RAM but these days RAM is cheap and plentiful and speed is the major consideration here. This should in theory be able to do this in a few hours with this technique. One thing to bear in mind is that once the UID change is complete you will have to backup the entire file system again. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Fife, United Kingdom.
I'm a little late to the party here but I thought I'd share our recent experiences. We recently completed a mass UID number migration (half a billion inodes) and developed two tools ("luke filewalker" and the "mmilleniumfacl") to get the job done. Both luke filewalker and the mmilleniumfacl are based heavily on the code in /usr/lpp/mmfs/samples/util/tsreaddir.c and /usr/lpp/mmfs/samples/util/tsinode.c. luke filewalker targets traditional POSIX permissions whereas mmilleniumfacl targets posix ACLs. Both tools traverse the filesystem in parallel and both but particularly the 2nd, are extremely I/O intensive on your metadata disks. The gist of luke filewalker is to scan the inode structures using the gpfs APIs and populate a mapping of inode number to gid and uid number. It then walks the filesystem in parallel using the APIs, looks up the inode number in an in-memory hash, and if appropriate changes ownership using the chown() API. The mmilleniumfacl doesn't have the luxury of scanning for POSIX ACLs using the GPFS inode API so it walks the filesystem and reads the ACL of any and every file, updating the ACL entries as appropriate. I'm going to see if I can share the source code for both tools, although I don't know if I can post it here since it modified existing IBM source code. Could someone from IBM chime in here? If I were to send the code to IBM could they publish it perhaps on the wiki? -Aaron On 6/30/17 11:20 AM, hpc-luke@uconn.edu wrote:
Hello,
We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days.
What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup.
Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process?
Thank you for your time,
Luke Storrs-HPC University of Connecticut _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
-- Aaron Knister NASA Center for Climate Simulation (Code 606.2) Goddard Space Flight Center (301) 286-2776
Oh, the one *huge* gotcha I thought I'd share-- we wrote a perl script to drive the migration and part of the perl script's process was to clone quotas from old uid numbers to the new number. I upset our GPFS cluster during a particular migration in which the user was over the grace period of the quota so after a certain point every chown() put the destination UID even further over its quota. The problem with this being that at this point every chown() operation would cause GPFS to do some cluster-wide quota accounting-related RPCs. That hurt. It's worth making sure there are no quotas defined for the destination UID numbers and if they are that the data coming from the source UID number will fit. -Aaron On 8/2/17 9:00 PM, Aaron Knister wrote:
I'm a little late to the party here but I thought I'd share our recent experiences.
We recently completed a mass UID number migration (half a billion inodes) and developed two tools ("luke filewalker" and the "mmilleniumfacl") to get the job done. Both luke filewalker and the mmilleniumfacl are based heavily on the code in /usr/lpp/mmfs/samples/util/tsreaddir.c and /usr/lpp/mmfs/samples/util/tsinode.c.
luke filewalker targets traditional POSIX permissions whereas mmilleniumfacl targets posix ACLs. Both tools traverse the filesystem in parallel and both but particularly the 2nd, are extremely I/O intensive on your metadata disks.
The gist of luke filewalker is to scan the inode structures using the gpfs APIs and populate a mapping of inode number to gid and uid number. It then walks the filesystem in parallel using the APIs, looks up the inode number in an in-memory hash, and if appropriate changes ownership using the chown() API.
The mmilleniumfacl doesn't have the luxury of scanning for POSIX ACLs using the GPFS inode API so it walks the filesystem and reads the ACL of any and every file, updating the ACL entries as appropriate.
I'm going to see if I can share the source code for both tools, although I don't know if I can post it here since it modified existing IBM source code. Could someone from IBM chime in here? If I were to send the code to IBM could they publish it perhaps on the wiki?
-Aaron
On 6/30/17 11:20 AM, hpc-luke@uconn.edu wrote:
Hello,
We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days.
What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup.
Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process?
Thank you for your time,
Luke Storrs-HPC University of Connecticut _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
-- Aaron Knister NASA Center for Climate Simulation (Code 606.2) Goddard Space Flight Center (301) 286-2776
On Wed, 2017-08-02 at 21:03 -0400, Aaron Knister wrote:
Oh, the one *huge* gotcha I thought I'd share-- we wrote a perl script to drive the migration and part of the perl script's process was to clone quotas from old uid numbers to the new number. I upset our GPFS cluster during a particular migration in which the user was over the grace period of the quota so after a certain point every chown() put the destination UID even further over its quota. The problem with this being that at this point every chown() operation would cause GPFS to do some cluster-wide quota accounting-related RPCs. That hurt. It's worth making sure there are no quotas defined for the destination UID numbers and if they are that the data coming from the source UID number will fit.
For similar reasons if you are doing a restore of a file system (any file system for that matter not just GPFS) for whatever reason, don't turn quotas back on till *after* the restore is complete. Well unless you can be sure a user is not going to go over quota during the restore. However as this is generally not possible to determine you end up with no quota's either set/enforced till the restore is complete. JAB. -- Jonathan A. Buzzard Tel: +44141-5483420 HPC System Administrator, ARCHIE-WeSt. University of Strathclyde, John Anderson Building, Glasgow. G4 0NG
Perhaps IBM might consider letting you commit it to https://github.com/gpfsug/gpfsug-tools he says, asking out loud... It'll require a friendly IBMer to take the reins up for you. Scott? :-) Jez On 03/08/17 02:00, Aaron Knister wrote:
I'm a little late to the party here but I thought I'd share our recent experiences.
We recently completed a mass UID number migration (half a billion inodes) and developed two tools ("luke filewalker" and the "mmilleniumfacl") to get the job done. Both luke filewalker and the mmilleniumfacl are based heavily on the code in /usr/lpp/mmfs/samples/util/tsreaddir.c and /usr/lpp/mmfs/samples/util/tsinode.c.
luke filewalker targets traditional POSIX permissions whereas mmilleniumfacl targets posix ACLs. Both tools traverse the filesystem in parallel and both but particularly the 2nd, are extremely I/O intensive on your metadata disks.
The gist of luke filewalker is to scan the inode structures using the gpfs APIs and populate a mapping of inode number to gid and uid number. It then walks the filesystem in parallel using the APIs, looks up the inode number in an in-memory hash, and if appropriate changes ownership using the chown() API.
The mmilleniumfacl doesn't have the luxury of scanning for POSIX ACLs using the GPFS inode API so it walks the filesystem and reads the ACL of any and every file, updating the ACL entries as appropriate.
I'm going to see if I can share the source code for both tools, although I don't know if I can post it here since it modified existing IBM source code. Could someone from IBM chime in here? If I were to send the code to IBM could they publish it perhaps on the wiki?
-Aaron
On 6/30/17 11:20 AM, hpc-luke@uconn.edu wrote:
Hello,
We're trying to change most of our users uids, is there a clean way to migrate all of one users files with say `mmapplypolicy`? We have to change the owner of around 273539588 files, and my estimates for runtime are around 6 days.
What we've been doing is indexing all of the files and splitting them up by owner which takes around an hour, and then we were locking the user out while we chown their files. I made it multi threaded as it weirdly gave a 10% speedup despite my expectation that multi threading access from a single node would not give any speedup.
Generally I'm looking for advice on how to make the chowning faster. Would spreading the chowning processes over multiple nodes improve performance? Should I not stat the files before running lchown on them, since lchown checks the file before changing it? I saw mention of inodescan(), in an old gpfsug email, which speeds up disk read access, by not guaranteeing that the data is up to date. We have a maintenance day coming up where all users will be locked out, so the file handles(?) from GPFS's perspective will not be able to go stale. Is there a function with similar constraints to inodescan that I can use to speed up this process?
Thank you for your time,
Luke Storrs-HPC University of Connecticut _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
-- *Jez Tucker* Head of Research and Development, Pixit Media 07764193820 | jtucker@pixitmedia.com <mailto:jtucker@pixitmedia.com> www.pixitmedia.com <http://www.pixitmedia.com> | Tw:@pixitmedia.com <https://twitter.com/PixitMedia> -- <http://pixitmedia.com> This email is confidential in that it is intended for the exclusive attention of the addressee(s) indicated. If you are not the intended recipient, this email should not be read or disclosed to any other person. Please notify the sender immediately and delete this email from your computer system. Any opinions expressed are not necessarily those of the company from which this email was sent and, whilst to the best of our knowledge no viruses or defects exist, no responsibility can be accepted for any loss or damage arising from its receipt or subsequent use of this email.
participants (6)
-
Aaron Knister -
Buterbaugh, Kevin L -
hpc-luke@uconn.edu -
Jez Tucker -
Jonathan Buzzard -
Jonathan Buzzard
