[slurm-users] Changing a user's default account

4,128 views
Skip to first unread message

Chip Seraphine

unread,
Aug 5, 2022, 10:55:55 AM8/5/22
to Slurm User Community List
I have a user U who is in association with account A, and I want to change that to account B. The obvious thing does not work:

$ sacctmgr modify user where user=”U” set defaultaccount=”B”
Can't modify because these users aren't associated with new default account “B”…

OK, fair enough. But I can’t find a good way to meet this requirement! “sacctmgr create assoc” does not seem to be a thing. Googling around I see a lot of wags deleting and recreating the user in this situation, which I definitely do _not_ want to do.

How does one change the account that a user is tied to?


--

Chip Seraphine
Linux Admin (Grid)

This e-mail and any attachments may contain information that is confidential and proprietary and otherwise protected from disclosure. If you are not the intended recipient of this e-mail, do not read, duplicate or redistribute it by any means. Please immediately delete it and any attachments and notify the sender that you have received it by mistake. Unintended recipients are prohibited from taking action on the basis of information in this e-mail or any attachments. The DRW Companies make no representations that this e-mail or any attachments are free of computer viruses or other defects.

Renfro, Michael

unread,
Aug 5, 2022, 11:17:14 AM8/5/22
to Slurm User Community List

This should work:


sacctmgr add user someuser account=newaccount # adds user to new account

 

sacctmgr modify user where user=someuser set defaultaccount=newaccount # change default

 

sacctmgr remove user where user=someuser and account=oldaccount # remove from old account

 

From: slurm-users <slurm-use...@lists.schedmd.com> on behalf of Chip Seraphine <csera...@DRWHoldings.com>
Date: Friday, August 5, 2022 at 9:56 AM
To: Slurm User Community List <slurm...@lists.schedmd.com>
Subject: [slurm-users] Changing a user's default account

External Email Warning

This email originated from outside the university. Please use caution when opening attachments, clicking links, or responding to requests.

________________________________

Chip Seraphine

unread,
Aug 5, 2022, 11:23:32 AM8/5/22
to Slurm User Community List
Thanks. Guess adding/deleting is the way to go then – I was hoping not to lose user history, but alas.

Tina Friedrich

unread,
Aug 5, 2022, 11:36:45 AM8/5/22
to slurm...@lists.schedmd.com
I'm not sure what you mean by loosing user history?

You did way you want to change the users association from account 'A' to
account 'B' - well, yes, that means associating the user with A (i.e.
adding them to account A), and removing them from B.

The removing from B is optional of course - users can be associated with
multiple accounts. Does mean that they can run jobs under multiple
accounts as well of course! So if you only wanted to change their
default account - add them to A and make A the default, and you're done.
Only if you want to prevent them from running jobs within account 'B' in
the future, you'll need to remove them from B.

I am pretty sure sacct information for past jobs run within project B
will not be changed to project A - so the user's job history won't be
changed by an account move.

Tina
--
Tina Friedrich, Advanced Research Computing Snr HPC Systems Administrator

Research Computing and Support Services
IT Services, University of Oxford
http://www.arc.ox.ac.uk http://www.it.ox.ac.uk

Joseph Francisco Guzman

unread,
Aug 5, 2022, 11:37:14 AM8/5/22
to Slurm User Community List

Hi Chip,

You don't have to delete the user, because a user can be in multiple accounts. Here's what I'd do:

  1. add the user to account B
  2. make account B their default
  3. remove them from account A

We often swap out user accounts like this.

Best,

Joseph


----------------------------------------
Joseph F. Guzman - ITS (HPC)

Northern Arizona University

Joseph....@nau.edu


From: slurm-users <slurm-use...@lists.schedmd.com> on behalf of Chip Seraphine <csera...@DRWHoldings.com>
Sent: Friday, August 5, 2022 8:23:09 AM

To: Slurm User Community List
Subject: Re: [slurm-users] Changing a user's default account
 

Thomas M. Payerle

unread,
Aug 5, 2022, 11:37:35 AM8/5/22
to Slurm User Community List
sacctmgr add/delete user basically adds/deletes a Slurm association for that user/cluster/account.

You need to add (an association for) the user for account B before you can change their default account to B.

You do *not* need to delete (the association for) the user with account A if not desired; it is perfectly allowed to have an user who is associated with more than one Slurm account --- the user can use e.g. sbatch --account A myjob.sh to submit a job charging against account A even if default account is account B.

If you do not wish to "lose history" as you put it but wish to prevent the user from using account A, you can
1) add user to account B
2) change defaultaccount for user to account B
3) disable the user's access to account A with something like
sacctmgr update where user=USERNAME account=A set MaxSubmitJobs=0

--
Tom Payerle
DIT-ACIGS/Mid-Atlantic Crossroads        pay...@umd.edu
5825 University Research Park               (301) 405-6135
University of Maryland
College Park, MD 20740-3831
Reply all
Reply to author
Forward
0 new messages