node status: display allocations using a device
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
### Nomad version
```
[root@base-machine ~]# nomad version
Nomad v1.9.6
```
### Operating system and Environment details
Plugin "nomad-usb-device" v0.4.0
OS: AlmaLinux 9.5
### Issue
When you inspect a node, for devices will appear something like this:
```
[root@base-machine ~]# nomad node status 1f5a5301
Device Resource Utilization
0627/usb/0001[001-002-001-0627-0001]
```
Even if the resource is in use, this is not shown. So it's not possible to know which resources are currently used. I know that allocations could be denied due to lack of resources, but cannot be tracked to the node level.
### Reproduction steps
1. install a device plugin (usb/nvidia)
2. run a job with device block
3. check node status
#### Expected Result
I expect to see which task uses the resources.
```
[root@base-machine ~]# nomad node status 1f5a5301
Device Resource Utilization
0627/usb/0001[001-002-001-0627-0001]
```
#### Actual Result
It shows the device stats or none ( based on the device used ).
```
[root@base-machine ~]# nomad node status 1f5a5301
Device Resource Utilization
0627/usb/0001[001-002-001-0627-0001]
```
### Job file (if appropriate)
```
job "redis" {
datacenters = ["dc1"]
type = "service"
group "redis" {
network {
port "redis" { to = 6379 }
}
task "redis" {
driver = "podman"
config {
image = "docker://redis"
ports = ["redis"]
}
resources {
memory = 1024
cores = 2
device "0627/usb/0001" {}
}
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with the provided Nomad job and a USB or NVIDIA device plugin, then run `nomad node status` and trace the Device Resource Utilization output. Done means a device in use displays the allocation ID, while unused devices retain the existing empty indicator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100