cacctmgr - Account Manager¶
cacctmgr manages accounts, users, and Quality of Service (QoS) settings in the CraneSched system using SQL-style commands.
Note
This command uses a SQL-style syntax for managing cluster resources. The syntax is: cacctmgr <ACTION> <ENTITY> [OPTIONS]
User Roles¶
CraneSched has four user privilege levels:
- Admin (System Administrator): Typically the root user, has full permissions to create, read, update, and delete any account or user
- Operator (Platform Administrator): Has complete permissions over the account system
- Coordinator (Account Coordinator): Has permissions over users in the same account and child accounts, including adding users
- None (Regular User): Can only query information within their own account, cannot modify user or account information
Command Syntax¶
Global Options¶
- -h, --help: Display help information
- -C, --config string: Configuration file path (default:
/etc/crane/config.yaml) - -v, --version: Display cacctmgr version
- -J, --json: Output in JSON format
- -f, --force: Force operation without confirmation
Actions¶
- add: Create a new account, user, or QoS
- delete: Remove an account, user, or QoS
- block: Block an account or user from using the system
- unblock: Unblock a previously blocked account or user
- modify: Change attributes using SQL-style SET clause
- show: Display information about entities
- reset: Reset user certificate
Entities¶
- account: User account in the system
- user: Individual user
- qos: Quality of Service settings
- transaction: Transaction log (for show action only)
1. Account Management¶
1.1 Add Account¶
Syntax:
Options:
- Description=
: Account description - Parent=
: Parent account name - DefaultQos=
: Default QoS for the account - Partition=
: Allowed partitions (comma-separated) - QosList=
: Allowed QoS list (comma-separated) - Name=
: Batch create multiple accounts (comma-separated)
Examples:
Create a simple account:
Create a child account:
Batch create accounts:
1.2 Delete Account¶
Syntax:
Note: You cannot delete an account that has child accounts or users. Remove them first.
Example:
1.3 Modify Account¶
Syntax:
Attributes:
- Description=
: Set description - DefaultQos=
: Set default QoS - AllowedPartition=
: Set allowed partitions (overwrites) - AllowedPartition+=
: Add partitions to allowed list - AllowedPartition-=
: Remove partitions from allowed list - AllowedQos=
: Set allowed QoS list (overwrites) - AllowedQos+=
: Add QoS to allowed list - AllowedQos-=
: Remove QoS from allowed list
Examples:
Change account description:
Add partitions to allowed list:
Remove partitions from allowed list:
Set allowed partitions (replace existing):
1.4 Show Accounts¶
Syntax:
Options:
- Name=
: Show specific accounts only
Examples:
Show all accounts:
Show specific account:
Show multiple accounts:
1.5 Block/Unblock Account¶
Syntax:
Examples:
Block an account:
Unblock an account:
2. User Management¶
2.1 Add User¶
Syntax:
Required:
- Account=
: Account the user belongs to (required)
Options:
- Coordinator=true|false: Set user as account coordinator
- Level=
: User admin level (none/operator/admin, default: none) - Partition=
: Allowed partitions (comma-separated) - Name=
: Batch create multiple users (comma-separated)
Note: The user must exist as a Linux system user (create with useradd first).
Examples:
Create a simple user:
Create user with specific permissions:
Create user as coordinator:
Batch create users:
useradd user1 && useradd user2 && useradd user3
cacctmgr add user batch Account=PKU Name=user1,user2,user3
2.2 Delete User¶
Syntax:
Options:
- Account=
: Specify account context (optional) - Name=
: Delete multiple users (comma-separated)
Special:
- If name is ALL and --force is set, all users from the specified account will be deleted
Examples:
Delete a user:
Delete user from specific account:
Delete all users from an account (with force):
2.3 Modify User¶
Syntax:
cacctmgr modify user where Name=<user> [Account=<account>] [Partition=<partitions>] set <ATTRIBUTE>=<value>
Where Clause:
- Name=
: User to modify (required) - Account=
: Account context (optional) - Partition=
: Partition context (optional)
Attributes:
- AdminLevel=
: Set admin level (none/operator/admin) - DefaultAccount=
: Set default account - DefaultQos=
: Set default QoS - AllowedPartition=
: Set allowed partitions (overwrites) - AllowedPartition+=
: Add partitions - AllowedPartition-=
: Remove partitions - AllowedQos=
: Set allowed QoS (overwrites) - AllowedQos+=
: Add QoS - AllowedQos-=
: Remove QoS
Examples:
Change user admin level:
Remove partition from user:
Add QoS to user:
2.4 Show Users¶
Syntax:
Options:
- Accounts=
: Show users of specific account only - Name=
: Show specific users only
Examples:
Show all users:
Show specific user:
Show users in an account:
2.5 Block/Unblock User¶
Syntax:
Required:
- Account=
: Account context is required for user block/unblock
Examples:
Block a user:
Unblock a user:
2.6 Reset User Certificate¶
Syntax:
Special:
- If name is all, all users' certificates will be reset
Examples:
Reset single user certificate:
Reset all users' certificates:
3. QoS Management¶
3.1 Add QoS¶
Syntax:
Options:
- Description=
: QoS description - Priority=
: Priority value (higher = higher priority) - MaxJobsPerUser=
: Maximum concurrent jobs per user - MaxCpusPerUser=
: Maximum CPUs per user - MaxTimeLimitPerTask=
: Maximum runtime per task (in seconds) - Name=
: Batch create multiple QoS (comma-separated)
Examples:
Create a QoS:
Create high-priority QoS:
cacctmgr add qos high Description="High Priority" Priority=5000 MaxJobsPerUser=20 MaxCpusPerUser=200 MaxTimeLimitPerTask=86400
Batch create QoS:
3.2 Delete QoS¶
Syntax:
Options:
- Name=
: Delete multiple QoS (comma-separated)
Example:
3.3 Modify QoS¶
Syntax:
Attributes:
- Description=
: Set description - MaxCpusPerUser=
: Set max CPUs per user - MaxJobsPerUser=
: Set max jobs per user - MaxTimeLimitPerTask=
: Set max time per task (seconds) - Priority=
: Set priority
Examples:
Change QoS priority:
Update resource limits:
3.4 Show QoS¶
Syntax:
Options:
- Name=
: Show specific QoS only
Examples:
Show all QoS:
Show specific QoS:
4. Transaction Log¶
4.1 Show Transaction Log¶
Syntax:
Where Options:
- Actor=
: Filter by user who performed the action - Target=
: Filter by target entity - Action=
: Filter by action type - Info=
: Filter by additional information - StartTime=
: Filter by start time
Example:
Show all transactions:
Show transactions by specific user:
Show transactions for a specific account:
Usage Examples¶
Complete Workflow Example¶
# 1. Create a QoS policy
cacctmgr add qos standard Description="Standard Queue" Priority=1000 MaxJobsPerUser=10
# 2. Create root account with partitions and QoS
cacctmgr add account University Description="University Account" Partition=CPU,GPU QosList=standard
# 3. Create department account under University
cacctmgr add account CS Description="Computer Science Dept" Parent=University
# 4. Create Linux user
useradd professor
# 5. Add user to account with coordinator privileges
cacctmgr add user professor Account=CS Level=operator Coordinator=true
# 6. Create student users
useradd student1 && useradd student2
cacctmgr add user batch Account=CS Name=student1,student2
# 7. Limit student1 to CPU partition only
cacctmgr modify user where Name=student1 Account=CS set AllowedPartition=CPU
# 8. View all users in CS account
cacctmgr show user Accounts=CS
# 9. Block a user temporarily
cacctmgr block user student2 Account=CS
# 10. Unblock the user
cacctmgr unblock user student2 Account=CS
# 11. View transaction history
cacctmgr show transaction where Actor=professor
JSON Output Example¶
Get results in JSON format for scripting:
Permission Matrix¶
| Action | Admin | Operator | Coordinator | User |
|---|---|---|---|---|
| Add Account | ✓ | ✓ | ✗ | ✗ |
| Delete Account | ✓ | ✓ | ✗ | ✗ |
| Modify Account | ✓ | ✓ | Own account | ✗ |
| Add User | ✓ | ✓ | Same account | ✗ |
| Delete User | ✓ | ✓ | Same account | ✗ |
| Modify User | ✓ | ✓ | Same account | ✗ |
| Add QoS | ✓ | ✓ | ✗ | ✗ |
| Delete QoS | ✓ | ✓ | ✗ | ✗ |
| Modify QoS | ✓ | ✓ | ✗ | ✗ |
| Show (Query) | ✓ | ✓ | ✓ | ✓ (own account) |
| Block/Unblock | ✓ | ✓ | Same account | ✗ |
Important Notes¶
-
Linux User Requirement: Before adding a user to cacctmgr, the user must exist as a Linux system user (create using
useradd) -
Account Hierarchy: When deleting accounts, ensure no child accounts or users exist under that account
-
Inheritance: Users inherit partition and QoS settings from their parent account unless explicitly overridden
-
Coordinator Privileges: Coordinators can manage users within their account but cannot modify their own account's parent
-
SQL-Style Syntax: The new syntax uses SQL-like
whereandsetclauses for modify operations, with+=and-=operators for list modifications