Skip to content

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

cacctmgr <ACTION> <ENTITY> [ID] [OPTIONS]

Global Options

  • -h, --help: Display help information
  • -C, --config string: Configuration file path (default: /etc/crane/config.yaml)
  • -p, --plugin-config string: Plugin configuration file path used by show event (default: /etc/crane/plugin.yaml)
  • -v, --version: Display cacctmgr version
  • -J, --json: Output in JSON format
  • -f, --force: Force operation without confirmation
  • -P, --partition-limit: Show partition resource limits in show account and show user output

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)
  • resource: Resource (License Resource)

1. Account Management

1.1 Add Account

Syntax:

cacctmgr add account <name> [OPTIONS]

Options:

  • Description=<desc>: Account description
  • Parent=<parent>: Parent account name
  • DefaultQos=<qos>: Default QoS for the account
  • Partition=<part1,part2,...>: Allowed partitions (comma-separated)
  • QosList=<qos1,qos2,...>: Allowed QoS list (comma-separated)
  • Name=<name1,name2,...>: Batch create multiple accounts (comma-separated)

Examples:

Create a simple account:

cacctmgr add account PKU Description="Peking University" Partition=CPU,GPU QosList=normal,high

Create a child account:

cacctmgr add account ComputingCentre Description="Computing Center" Parent=PKU

Batch create accounts:

cacctmgr add account dept Name=CS,Math,Physics Parent=PKU

1.2 Delete Account

Syntax:

cacctmgr delete account <name>

Note: You cannot delete an account that has child accounts or users. Remove them first.

Example:

cacctmgr delete account ComputingCentre

1.3 Modify Account

Syntax:

cacctmgr modify account where Name=<account> [Partition=<partition>] set <ATTRIBUTE>=<value>

Attributes:

  • Description=<desc>: Set description
  • DefaultQos=<qos>: Set default QoS
  • AllowedPartition=<partitions>: Set allowed partitions (overwrites)
  • AllowedPartition+=<partitions>: Add partitions to allowed list
  • AllowedPartition-=<partitions>: Remove partitions from allowed list
  • AllowedQos=<qos_list>: Set allowed QoS list (overwrites)
  • AllowedQos+=<qos_list>: Add QoS to allowed list
  • AllowedQos-=<qos_list>: Remove QoS from allowed list
  • MaxJobs=<num>: Set maximum concurrent running jobs in the specified partition (requires Partition=<partition>)
  • MaxSubmitJobs=<num>: Set maximum submitted jobs in the specified partition (requires Partition=<partition>)
  • MaxTres=<tres>: Set maximum total TRES usage in the specified partition (requires Partition=<partition>)
  • MaxTresPerJob=<tres>: Set maximum TRES per job in the specified partition (requires Partition=<partition>)
  • MaxWall=<seconds>: Set cumulative wall-clock time limit in the specified partition (requires Partition=<partition>)
  • MaxWallPerJob=<seconds>: Set per-job wall-clock time limit in the specified partition (requires Partition=<partition>)

Examples:

Change account description:

cacctmgr modify account where Name=ComputingCentre set Description="HPC Computing Center"

Add partitions to allowed list:

cacctmgr modify account where Name=PKU set AllowedPartition+=GPU2,GPU3

Remove partitions from allowed list:

cacctmgr modify account where Name=PKU set AllowedPartition-=GPU

Set allowed partitions (replace existing):

cacctmgr modify account where Name=PKU set AllowedPartition=CPU,GPU

Set account resource limits in partition GPU:

cacctmgr modify account where Name=PKU Partition=GPU \
  set MaxJobs=20 MaxSubmitJobs=100 MaxTresPerJob=cpu:8,mem:32G MaxWallPerJob=7200

1.4 Show Accounts

Syntax:

cacctmgr show account [name] [OPTIONS]

Options:

  • Name=<name1,name2,...>: Show specific accounts only
  • -P, --partition-limit: Also show account resource limits in each partition

Examples:

Show all accounts:

cacctmgr show account

Show specific account:

cacctmgr show account PKU

Show multiple accounts:

cacctmgr show account Name=PKU,ComputingCentre

Show account partition resource limits:

cacctmgr show account PKU -P

1.5 Block/Unblock Account

Syntax:

cacctmgr block account <name>
cacctmgr unblock account <name>

Examples:

Block an account:

cacctmgr block account ComputingCentre

Unblock an account:

cacctmgr unblock account ComputingCentre

2. User Management

2.1 Add User

Syntax:

cacctmgr add user <name> Account=<account> [OPTIONS]

Required:

  • Account=<account>: Account the user belongs to (required)

Options:

  • Coordinator=true|false: Set user as account coordinator
  • Level=<level>: User admin level (none/operator/admin, default: none)
  • Partition=<part1,part2,...>: Allowed partitions (comma-separated)
  • Name=<name1,name2,...>: 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:

useradd alice
cacctmgr add user alice Account=PKU

Create user with specific permissions:

useradd bob
cacctmgr add user bob Account=PKU Level=operator Partition=CPU,GPU

Create user as coordinator:

useradd charlie
cacctmgr add user charlie Account=PKU Coordinator=true

Batch create users:

useradd user1 && useradd user2 && useradd user3
cacctmgr add user batch Account=PKU Name=user1,user2,user3

2.2 Delete User

Syntax:

cacctmgr delete user <name> [Account=<account>]

Options:

  • Account=<account>: Specify account context (optional)
  • Name=<name1,name2,...>: 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:

cacctmgr delete user alice

Delete user from specific account:

cacctmgr delete user bob Account=PKU

Delete all users from an account (with force):

cacctmgr delete user ALL Account=PKU --force

2.3 Modify User

Syntax:

cacctmgr modify user where Name=<user> [Account=<account>] [Partition=<partitions>] set <ATTRIBUTE>=<value>

Where Clause:

  • Name=<user>: User to modify (required)
  • Account=<account>: Account context (optional)
  • Partition=<partitions>: Partition context (optional)

Attributes:

  • AdminLevel=<level>: Set admin level (none/operator/admin)
  • DefaultAccount=<account>: Set default account
  • DefaultQos=<qos>: Set default QoS
  • AllowedPartition=<partitions>: Set allowed partitions (overwrites)
  • AllowedPartition+=<partitions>: Add partitions
  • AllowedPartition-=<partitions>: Remove partitions
  • AllowedQos=<qos_list>: Set allowed QoS (overwrites)
  • AllowedQos+=<qos_list>: Add QoS
  • AllowedQos-=<qos_list>: Remove QoS
  • MaxJobs=<num>: Set maximum concurrent running jobs in the specified partition (requires Partition=<partition>)
  • MaxSubmitJobs=<num>: Set maximum submitted jobs in the specified partition (requires Partition=<partition>)
  • MaxTres=<tres>: Set maximum total TRES usage in the specified partition (requires Partition=<partition>)
  • MaxTresPerJob=<tres>: Set maximum TRES per job in the specified partition (requires Partition=<partition>)
  • MaxWall=<seconds>: Set cumulative wall-clock time limit in the specified partition (requires Partition=<partition>)
  • MaxWallPerJob=<seconds>: Set per-job wall-clock time limit in the specified partition (requires Partition=<partition>)

Examples:

Change user admin level:

cacctmgr modify user where Name=alice Account=PKU set AdminLevel=operator

Remove partition from user:

cacctmgr modify user where Name=bob set AllowedPartition-=GPU

Add QoS to user:

cacctmgr modify user where Name=charlie set AllowedQos+=high

Set user resource limits in partition GPU under account PKU:

cacctmgr modify user where Name=alice Account=PKU Partition=GPU \
  set MaxJobs=5 MaxSubmitJobs=20 MaxTresPerJob=cpu:4,mem:16G MaxWallPerJob=3600

2.4 Show Users

Syntax:

cacctmgr show user [name] [OPTIONS]

Options:

  • Accounts=<account>: Show users of specific account only
  • Name=<name1,name2,...>: Show specific users only
  • -P, --partition-limit: Also show user resource limits by account and partition

Examples:

Show all users:

cacctmgr show user

Show specific user:

cacctmgr show user alice

Show users in an account:

cacctmgr show user Accounts=PKU

Show user partition resource limits:

cacctmgr show user alice -P

2.5 Block/Unblock User

Syntax:

cacctmgr block user <name> Account=<account>
cacctmgr unblock user <name> Account=<account>

Required:

  • Account=<account>: Account context is required for user block/unblock

Examples:

Block a user:

cacctmgr block user alice Account=PKU

Unblock a user:

cacctmgr unblock user alice Account=PKU

2.6 Reset User Certificate

Syntax:

cacctmgr reset <name>

Special:

  • If name is all, all users' certificates will be reset

Examples:

Reset single user certificate:

cacctmgr reset alice

Reset all users' certificates:

cacctmgr reset all

3. QoS Management

3.1 Add QoS

Syntax:

cacctmgr add qos <name> [OPTIONS]

Options:

  • Description=<desc>: QoS description
  • Priority=<priority>: Priority value (higher = higher priority)
  • MaxJobsPerUser=<num>: Maximum concurrent jobs per user
  • MaxCpusPerUser=<num>: Maximum CPUs per user
  • MaxTimeLimitPerTask=<seconds>: Maximum runtime per task (in seconds)
  • Name=<name1,name2,...>: Batch create multiple QoS (comma-separated)

Examples:

Create a QoS:

cacctmgr add qos normal Description="Normal QoS" Priority=1000 MaxJobsPerUser=10 MaxCpusPerUser=100

Create high-priority QoS:

cacctmgr add qos high Description="High Priority" Priority=5000 MaxJobsPerUser=20 MaxCpusPerUser=200 MaxTimeLimitPerTask=86400

Batch create QoS:

cacctmgr add qos batch Name=low,medium,high Priority=500

3.2 Delete QoS

Syntax:

cacctmgr delete qos <name>

Options:

  • Name=<name1,name2,...>: Delete multiple QoS (comma-separated)

Example:

cacctmgr delete qos low

3.3 Modify QoS

Syntax:

cacctmgr modify qos where Name=<qos> set <ATTRIBUTE>=<value>

Attributes:

  • Description=<desc>: Set description
  • MaxCpusPerUser=<num>: Set max CPUs per user
  • MaxJobsPerUser=<num>: Set max jobs per user
  • MaxTimeLimitPerTask=<seconds>: Set max time per task (seconds)
  • Priority=<priority>: Set priority

Examples:

Change QoS priority:

cacctmgr modify qos where Name=normal set Priority=2000

Update resource limits:

cacctmgr modify qos where Name=high set MaxJobsPerUser=50 MaxCpusPerUser=500

3.4 Show QoS

Syntax:

cacctmgr show qos [name] [OPTIONS]

Options:

  • Name=<name1,name2,...>: Show specific QoS only

Examples:

Show all QoS:

cacctmgr show qos

Show specific QoS:

cacctmgr show qos normal

4. Transaction Log

4.1 Show Transaction Log

Syntax:

cacctmgr show transaction where [OPTIONS]

Where Options:

  • Actor=<username>: Filter by user who performed the action
  • Target=<target>: Filter by target entity
  • Action=<action>: Filter by action type
  • Info=<info>: Filter by additional information
  • StartTime=<timestamp>: Filter by start time

Example:

Show all transactions:

cacctmgr show transaction

Show transactions by specific user:

cacctmgr show transaction where Actor=admin

Show transactions for a specific account:

cacctmgr show transaction where Target=PKU

5. Wckey Management

5.1 Add Wckey

Syntax:

cacctmgr add wckey <name> [options]

Options:

  • User=<username>: Username (required)

Example:

Add Wckey

cacctmgr add wckey hpcgroup User=zhangsan

5.2 Delete Wckey

Syntax:

cacctmgr delete wckey <name> [options]

Options:

  • User=<username>: Username (required)

Example:

cacctmgr delete wckey hpcgroup User=zhangsan

5.3 Modify Default Wckey

Syntax:

cacctmgr modify wckey where User=<name> set DefaultWckey=<wckey>

Options:

  • User=<username>: Username (required)
  • DefaultWckey=<Wckey name>: Existing Wckey name (required)

Example:

Modify default Wckey

cacctmgr modify wckey where User=zhangsan set DefaultWckey=hpcgroup

5.4 Show Wckey

Syntax:

cacctmgr show wckey [name]

Options:

  • Name=<name1,name2,...>: Show specific Wckeys only (comma-separated)

Example:

Show all Wckeys

cacctmgr show wckey

6. Resource Management

6.1 Add Resource

Syntax:

cacctmgr add resource <name> [options]

Options:

  • Description=: Resource description
  • Name=: Resource name
  • Server=: Resource server
  • ServerType=: Type of resource server
  • Type=: Resource type (License, NotSet)
  • Count=: Total amount of the resource
  • LastConsumed=: Usage count obtained from external source
  • Allocated=: Number of allocated resources
  • Flags=: Resource flags (None, Absolute)
  • Allowed=: Amount available to the cluster
  • Cluster=: Cluster name

Examples:

Create a resource:

cacctmgr add resource matlab count=50 server=rlm_host \
  servertype=rlm type=license

Create a resource and assign it to clusters:

cacctmgr add resource nastran cluster=fluid,pdf \
  server=flex_host servertype=flexlm \
  count=100 allowed=50 type=license

6.2 Delete Resource

Syntax:

cacctmgr delete resource <name>

Options:

  • Name=: Resource name to delete
  • Server=: Resource server
  • Cluster=: Target clusters

Examples:

cacctmgr delete resource matlab server=rlm_host cluster=fluid

cacctmgr delete resource nastran server=flex_host

6.3 Modify Resource

Syntax:

cacctmgr modify resource where Name=<resource> Server=<server> Cluster=<cluster1,cluster2,..> set <attribute>=<value>

Attributes:

  • Description=: Resource description
  • ServerType=: Resource server type
  • Type=: Resource type (License, NotSet)
  • Count=: Resource quantity
  • LastConsumed=: External usage count
  • Allocated=: Allocated resource amount
  • Flags=: Resource flags (None, Absolute)
  • Allowed=: Amount allowed for the cluster (cluster must be specified)

Examples:

Modify resource count:

cacctmgr modify resource name=matlab server=rlm_host set \
  count=200

Update resource allocation for a cluster:

cacctmgr modify resource name=matlab server=rlm_host \
  cluster=pdf set allowed=60

6.4 Show Resources

Syntax:

cacctmgr show resource [withclusters] where [options]

Options:

  • Name=: Show only the specified resource
  • Server=: Show resources for a specific server
  • cluster=: Cluster name

Examples:

Show all resources:

cacctmgr show resource

cacctmgr show resource withclusters

Show a specific resource:

cacctmgr show resource where name=matlab server=rlm_host cluster=fluid


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:

cacctmgr show account --json
cacctmgr show user Accounts=PKU --json
cacctmgr show qos --json

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 ✗
Add Resource ✓ ✓ ✗ ✗
Delete Resource ✓ ✓ ✗ ✗
Modify Resource ✓ ✓ ✗ ✗
---

Important Notes

  1. Linux User Requirement: Before adding a user to cacctmgr, the user must exist as a Linux system user (create using useradd)

  2. Account Hierarchy: When deleting accounts, ensure no child accounts or users exist under that account

  3. Inheritance: Users inherit partition and QoS settings from their parent account unless explicitly overridden

  4. Coordinator Privileges: Coordinators can manage users within their account but cannot modify their own account's parent

  5. SQL-Style Syntax: The new syntax uses SQL-like where and set clauses for modify operations, with += and -= operators for list modifications

See Also

  • cbatch - Submit batch jobs
  • cqueue - View job queue
  • cacct - View job accounting information