[slurm-users] Adding Users to Slurm's Database

Tina Friedrich tina.friedrich at it.ox.ac.uk
Tue Aug 18 15:56:09 UTC 2020


Script. Not doing manual anything if it can at all be avoided, way to 
error prone.

We have a cron job that does all of that. Checks if there are users or 
groups in LDAP that aren't in SLURM yet, and adds them - that's adding 
accounts, adding users, .... I think it also removed users/accounts if 
necessary, and also handles user<->account associations, as those can 
change (we allow users in multiple groups), and it makes a valient 
attempt at changing default associations if they need changing, I believe.

I think it runs every 15 minutes.

The problem/pitfall that I can see is if a script is coded to, 
basically, loop through all users running sacctmgr for each to check it 
exists. We very definitely do not do that - the script gets all users, 
accounts & associations from SLURM and the equivalent from LDAP and 
then, basically, does a couple of list compares.

Tina

On 18/08/2020 16:36, Jason Simms wrote:

> Hello everyone! We have a script that queries our LDAP server for any 
> users that have an entitlement to use the cluster, and if they don't 
> already have an account on the cluster, one is created for them. In 
> addition, they need to be added to the Slurm database (in order to 
> track usage, FairShare, etc.).
>
> I've been doing this manually with a command like this:
>
> sacctmgr add user <username> Account=root DefaultAccount=root
>
> I would like to add that command to the user creation script, but I'm 
> warned off by the Slurm docs that say never to call sacctmgr in a 
> script/loop. I understand the reasons why doing so multiple times in 
> rapid succession can be a bad idea. In our case, however, it would be 
> rare to have more than one new user at a time (our script runs in 
> 15-min. intervals). Is there really a concern in a case like ours?
>
> How do you all handle adding users to Slurm's DB? Manually? Or, if not 
> by script or some automated means...??
>
> Warmest regards,
> Jason
>
> -- 
> *Jason L. Simms, Ph.D., M.P.H.*
> Manager of Research and High-Performance Computing
> XSEDE Campus Champion
> Lafayette College
> Information Technology Services
> 710 Sullivan Rd | Easton, PA 18042
> Office: 112 Skillman Library
> p: (610) 330-5632



More information about the slurm-users mailing list