Ticket 10855

Summary: Reservation comment
Product: Slurm Reporter: Matt Ezell <ezellma>
Component: slurmctldAssignee: Danny Auble <da>
Status: RESOLVED FIXED QA Contact:
Severity: 5 - Enhancement    
Priority: --- CC: sts
Version: 21.08.x   
Hardware: Linux   
OS: Linux   
Site: ORNL-OLCF Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 23.02.0pre1 Target Release: 23.02
DevPrio: 1 - Paid Emory-Cloud Sites: ---
Attachments: patch_v1

Description Matt Ezell 2021-02-12 08:30:44 MST
It would be useful to have a mutable free-form text field (comment or reason) that can be associated with a reservation.

We are still working through our best practices for handling marking nodes for maintenance (setting a MAINT reservation for a node vs marking it down/drain with a reason) for issues that are (detected automatically, detected by a human), (detected in-band, detected out-of-band), (expected to be transient, expected to be permanent). One issue with MAINT reservations is that you can't store any custom data about why the reservation exists anywhere but the name.
Comment 1 Tim Wickberg 2021-02-12 11:27:10 MST
Hey Matt -

Adding a 'Comment' field sounds reasonable.

Is this something you're looking to submit as a patch at some point, or something you're considering sponsoring?

- Tim
Comment 2 Matt Ezell 2021-02-12 11:33:32 MST
(In reply to Tim Wickberg from comment #1)
> Adding a 'Comment' field sounds reasonable.
> 
> Is this something you're looking to submit as a patch at some point, or
> something you're considering sponsoring?

Do you think the comment needs to be stored in the database, or just in slurmctld If just slurmctld, I can probably put together a patch pretty easily. I'm not familiar with the database code, so if I need to touch that it will take longer OR need to be sponsored.
Comment 3 Tim Wickberg 2021-02-12 13:23:31 MST
(In reply to Matt Ezell from comment #2)
> (In reply to Tim Wickberg from comment #1)
> > Adding a 'Comment' field sounds reasonable.
> > 
> > Is this something you're looking to submit as a patch at some point, or
> > something you're considering sponsoring?
> 
> Do you think the comment needs to be stored in the database, or just in
> slurmctld If just slurmctld, I can probably put together a patch pretty
> easily. I'm not familiar with the database code, so if I need to touch that
> it will take longer OR need to be sponsored.

It should end up in the database alongside the other comment types. Even if you don't need it there, someone will want it, and I won't be able to accept a patch that doesn't cover that obvious use case.
Comment 4 Matt Ezell 2021-02-15 18:11:12 MST
Created attachment 17943 [details]
patch_v1
Comment 5 Matt Ezell 2021-02-15 18:15:44 MST
[root@ezy-vm ~]# scontrol show res
No reservations in the system
[root@ezy-vm ~]# scontrol create res=kale start=now duration=10:00 user=root nodes=ALL comment="test1"
Reservation created: kale
[root@ezy-vm ~]# scontrol show res
ReservationName=kale StartTime=2021-02-15T20:12:37 EndTime=2021-02-15T20:22:37 Duration=00:10:00
   Nodes=ezy-vm NodeCnt=1 CoreCnt=2 Features=(null) PartitionName=(null) Flags=SPEC_NODES,ALL_NODES
   TRES=cpu=2
   Users=root Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null) Watts=n/a
   MaxStartDelay=(null) Comment=test1

[root@ezy-vm ~]# scontrol update res=kale comment="test 2"
Reservation updated.
[root@ezy-vm ~]# scontrol show res
ReservationName=kale StartTime=2021-02-15T20:12:37 EndTime=2021-02-15T20:22:37 Duration=00:10:00
   Nodes=ezy-vm NodeCnt=1 CoreCnt=2 Features=(null) PartitionName=(null) Flags=SPEC_NODES,ALL_NODES
   TRES=cpu=2
   Users=root Groups=(null) Accounts=(null) Licenses=(null) State=ACTIVE BurstBuffer=(null) Watts=n/a
   MaxStartDelay=(null) Comment=test 2

[root@ezy-vm ~]# sacctmgr show reservation |grep kale
   cluster            kale                          cpu=2 2021-02-15T20:12:37 2021-02-15T20:12:58   0.000000                test1 
   cluster            kale                          cpu=2 2021-02-15T20:12:58 2021-02-15T20:22:37   0.000000               test 2 
[root@ezy-vm ~]# echo -e "GET /slurm/v0.0.37/reservations HTTP/1.1\r\n" | slurmrestd -a rest_auth/local
slurmrestd: operations_router: [fd:0->/dev/pts/8] GET /slurm/v0.0.37/reservations
slurmrestd: rest_auth/local: slurm_rest_auth_p_authenticate: slurm_rest_auth_p_authenticate: [fd:0->/dev/pts/8] accepted connection from uid:0
slurmrestd: rest_auth/local: slurm_rest_auth_p_apply: apply local auth for user root
HTTP/1.1 200 OK
Content-Length: 861
Content-Type: application/json

{
   "meta": {
     "plugin": {
       "type": "openapi\/v0.0.37",
       "name": "REST v0.0.37"
     },
     "Slurm": {
       "version": {
         "major": 21,
         "micro": 0,
         "minor": 8
       },
       "release": "21.08.0-0pre1"
     }
   },
   "errors": [
   ],
   "reservations": [
     {
       "flags": [
         "SPEC_NODES",
         "ALL_NODES"
       ],
       "accounts": "",
       "burst_buffer": "",
       "comment": "test 2",
       "core_count": 2,
       "core_spec_cnt": 0,
       "end_time": 1613438557,
       "features": "",
       "groups": "",
       "licenses": "",
       "max_start_delay": 0,
       "name": "kale",
       "node_count": 1,
       "node_list": "ezy-vm",
       "partition": "",
       "start_time": 1613437957,
       "watts": 4294967294,
       "tres": "cpu=2",
       "users": "root"
     }
   ]
 }
Comment 6 Matt Ezell 2021-07-21 11:20:45 MDT
Will this be reviewed in time for 21.08? I'm not sure if it even applies cleanly anymore...
Comment 9 Danny Auble 2022-10-25 16:23:01 MDT
Comment on attachment 17943 [details]
patch_v1

A slightly modified version of this was added to the master branch commits 86db23a704..1bde461f94.

Thanks!
Comment 10 Danny Auble 2022-10-25 16:23:21 MDT
Please reopen if needed.