ccontrol - Control Cluster Resources¶
ccontrol is a command-line tool for managing and controlling CraneSched cluster resources.
ccontrol provides SQL-style syntax for managing nodes, partitions, jobs, and reservations in a CraneSched cluster. The tool supports operations such as viewing status, updating configurations, holding/releasing jobs, and creating/deleting reservations.
Command Structure¶
Actions¶
- show - Display information about entities
- update - Modify attributes of entities
- hold - Hold entities (prevent jobs from starting)
- release - Release previously held entities
- create - Create new entities
- delete - Delete existing entities
Entities¶
- node - Compute nodes
- partition - Node partitions
- job - Jobs/tasks
- reservation - Resource reservations
- lic - License
Global Options¶
- -h/--help: Display help message
- -v/--version: Show version information
- -J/--json: Format output as JSON
- -C/--config: Specify alternative configuration file path (default: "/etc/crane/config.yaml")
Command Reference¶
Show Commands¶
Show Nodes¶
Display information about compute nodes.
Example:

Show Partitions¶
Display information about partitions.
# Show all partitions
ccontrol show partition
# Show specific partition
ccontrol show partition <partition_name>
Example:

Show Jobs¶
Display information about jobs.
Example:

Show Reservations¶
Display information about reservations.
# Show all reservations
ccontrol show reservation
# Show specific reservation
ccontrol show reservation <reservation_name>
Example:

Show License¶
Display information about the license.
Example:
Update Commands¶
Update Node¶
Modify node attributes, typically to drain or resume nodes.
Parameters:
- nodeName (required): Name of the node to update
- state (required): New state for the node
drain- Prevent new jobs from being scheduled on the noderesume- Make node available for scheduling again- reason (required when draining): Reason for draining the node
Examples:
# Drain a node
ccontrol update nodename=crane01 state=drain reason="Maintenance"
# Resume a node
ccontrol update nodename=crane01 state=resume

Update Job¶
Modify job attributes including priority, time limit, comment, and email settings.
ccontrol update jobid=<job_id> [priority=<priority>] [timelimit=<timelimit>] [comment=<comment>] [mailuser=<email>] [mailtype=<type>]
Parameters:
- jobid (required): ID of the job to update
- priority (optional): New priority value (floating-point number)
- timelimit (optional): New time limit (format: HH:MM:SS or D-HH:MM:SS)
- comment (optional): New comment string for the job
- mailuser (optional): Email address for notifications
- mailtype (optional): Type of email notifications (NONE, BEGIN, END, FAIL, TIMELIMIT, ALL)
Examples:
# Update job priority
ccontrol update jobid=11 priority=100
# Update time limit
ccontrol update jobid=11 timelimit=01:00:00
# Update multiple attributes
ccontrol update jobid=11 priority=1 timelimit=01:00:00 comment="High priority job"
# Update email notifications
ccontrol update jobid=11 mailuser=user@example.com mailtype=END

Update Partition¶
Modify partition access control lists.
Parameters:
- partitionName (required): Name of the partition to update
- accounts (optional): Comma-separated list of accounts allowed to use the partition
- deniedaccounts (optional): Comma-separated list of accounts denied from using the partition
Note: When AllowedAccounts is set, DeniedAccounts will not take effect.
Examples:
# Allow specific accounts
ccontrol update partition=GPU accounts=research,staff
# Deny specific accounts
ccontrol update partition=CPU deniedaccounts=guest

Hold and Release Commands¶
Hold Job¶
Hold specified job(s) to prevent them from starting.
Parameters:
- job_id (required): ID of the job to hold
- timelimit (optional): Duration to hold the job (format: HH:MM:SS)
Examples:
# Hold a job indefinitely
ccontrol hold 1
# Hold a job for 1 hour
ccontrol hold 1 timelimit=01:00:00

Release Job¶
Release a previously held job.
Example:

Create and Delete Commands¶
Create Reservation¶
Create a new resource reservation.
ccontrol create reservation <name> startTime=<time> duration=<duration> account=<account> [partition=<partition>] [nodes=<nodelist>] [nodeCnt=<count>] [user=<username>]
Parameters:
- name (required): Name of the reservation
- startTime (required): When the reservation starts (format: YYYY-MM-DDTHH:MM:SS)
- duration (required): Length of reservation (format: HH:MM:SS or D-HH:MM:SS)
- account (required): Account to associate with the reservation
- partition (optional): Partition to reserve resources from
- nodes (optional): Specific nodes to reserve (comma-separated list)
- nodeCnt (optional): Number of nodes to reserve (used when nodes is not specified)
- user (optional): User to associate with the reservation
Examples:
# Create a reservation with specific nodes
ccontrol create reservation my_reservation startTime=2024-12-01T10:00:00 duration=01:00:00 partition=CPU nodes=crane01,crane02 account=research
# Create a reservation with node count
ccontrol create reservation test_reservation startTime=2024-12-01T14:00:00 duration=02:00:00 partition=GPU nodeCnt=2 account=staff user=alice

Delete Reservation¶
Delete an existing reservation.
Example:

JSON Output¶
All commands support JSON output format using the --json flag:
This is useful for scripting and automation purposes.
Permission Requirements¶
Different operations require different permission levels:
| Operation | Permission Required |
|---|---|
| Show commands | User can view their own jobs; admin can view all |
| Update node | Administrator only |
| Update partition | Administrator only |
| Update job | Job owner or administrator |
| Hold/Release job | Job owner or administrator |
| Create reservation | Administrator or authorized user |
| Delete reservation | Reservation creator or administrator |
Use Cases¶
Node Maintenance¶
# Drain node for maintenance
ccontrol update nodename=crane01 state=drain reason="Hardware upgrade"
# After maintenance, resume node
ccontrol update nodename=crane01 state=resume
Job Priority Management¶
# Increase priority for urgent job
ccontrol update jobid=1234 priority=1000
# Extend time limit for long-running job
ccontrol update jobid=1234 timelimit=10:00:00
Resource Reservation¶
# Reserve nodes for scheduled maintenance window
ccontrol create reservation maint_window startTime=2024-12-15T02:00:00 duration=04:00:00 partition=ALL nodes=crane[01-10] account=admin
# Delete reservation when no longer needed
ccontrol delete reservation maint_window