Document PciBusID format
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
While building [my Nomad Device Plugin](https://github.com/hashicorp/nomad/blob/8a4bd61caf747f50416c44d5a8b39eb06226ff9e/plugins/device/device.go#L149), I struggled to identify the exact format for [`DeviceLocality.PciBusID string`](https://github.com/hernad/nomad/blob/v1.6.112/plugins/device/device.go#L150).
I note that the [Nomad docs show GUIDs](https://github.com/hashicorp/nomad/blob/8a4bd61caf747f50416c44d5a8b39eb06226ff9e/website/content/api-docs/nodes.mdx#L379) like `"PciBusID": "77cda534-0660-2688-6c2e-ad6c62fc5ff3"`. But I think that's because that's what the unit tests used?
I couldn't find how the NVidia plugin did it since I don't have any NVidia devices and the `nvml` API docs didn't say.
I want to make sure I present a value that is used appropriately by the Nomad Scheduler...
I ended up [using values like](https://github.com/neomantra/nomad-onload/blob/main/internal/onload_device/probes.go#L83) this `0000:b1:00.0`, as that's what comes back from `lshw -businfo -class network`:
```
// "lshw -businfo -class network" sample output:
// Bus info Device Class Description
// =======================================================
// pci@0000:04:00.0 eth2 network NetXtreme BCM5720 Gigabit Ethernet PCIe
// pci@0000:04:00.1 eth3 network NetXtreme BCM5720 Gigabit Ethernet PCIe
// pci@0000:31:00.0 network BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller
// pci@0000:31:00.1 network BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller
// pci@0000:98:00.0 eth4 network BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller
// pci@0000:98:00.1 eth5 network BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller
// pci@0000:b1:00.0 eth0 network SFC9220 10/40G Ethernet Controller
// pci@0000:b1:00.1 eth1 network SFC9220 10/40G Ethernet Controller
```
If there is an expected format, please document it.
Overall, it was pretty easy to make that plugin, thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with plugins/device/device.go, especially DeviceLocality.PciBusID, and compare its use with the examples in website/content/api-docs/nodes.mdx and the linked device-plugin implementation. Determine the accepted PCI bus identifier format and update the Nomad node API documentation with a representative value and explanation; done means plugin authors can identify the correct format without consulting external sources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100