Documentation
¶
Index ¶
- func GPU(p *PCI) bool
- func GetDevice(vendor uint16, device uint16) (v Vendor, d Device, ok bool)
- func IsSecureBoot() (bool, error)
- func PCIBridge(p *PCI) bool
- type Capacity
- type Device
- type Disks
- type Filter
- type PCI
- type ResourceOracle
- func (r *ResourceOracle) DMI() (*dmi.DMI, error)
- func (r *ResourceOracle) Disks() (d Disks, err error)
- func (r *ResourceOracle) GPUs() ([]PCI, error)
- func (r *ResourceOracle) GetHypervisor() (string, error)
- func (r *ResourceOracle) Total() (c gridtypes.Capacity, err error)
- func (r *ResourceOracle) Uptime() (uint64, error)
- type Subdevice
- type Vendor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GPU ¶
GPU Filter only devices with GPU capabilities NOTE: we only also now white list NVIDIA and AMD we skip integrated GPU normally on slots `0000:00:XX.X` and allow only discrete ones normally on slot `0000:XX:YY.ZZ`
func IsSecureBoot ¶
Types ¶
type Capacity ¶
type Capacity struct { CRU uint64 `json:"cru"` MRU uint64 `json:"mru"` SRU uint64 `json:"sru"` HRU uint64 `json:"hru"` }
Capacity hold the amount of resource unit of a node
type Device ¶
type Device struct { // ID is device id according to PCI database ID uint16 // Name is device name according to PCI database Name string // Subdevices is a slice of all subdevices according to PCI database Subdevices []Subdevice }
Device is a PCI device
type Disks ¶
type Disks struct { Tool string `json:"tool"` Environment string `json:"environment"` Aggregator string `json:"aggregator"` Devices []smartctl.Info `json:"devices"` }
Disks contains the hardware information about the disk of a node
type PCI ¶
type PCI struct { // Slot is the PCI device slot Slot string // Vendor of the device Vendor uint16 // Device id Device uint16 // Class of the device Class uint32 // Subsystem Vendor of the device SubsystemVendor uint16 // Subsystem ID of the device SubsystemDevice uint16 }
PCI device
func IoMMUGroup ¶
IoMMUGroup given a pci device, return all devices in the same iommu group
func (*PCI) GetSubdevice ¶
GetSubdevice gets the attached PCI subdevice information
type ResourceOracle ¶
type ResourceOracle struct {
// contains filtered or unexported fields
}
ResourceOracle is the structure responsible for capacity tracking
func NewResourceOracle ¶
func NewResourceOracle(s *stubs.StorageModuleStub) *ResourceOracle
NewResourceOracle creates a new ResourceOracle
func (*ResourceOracle) DMI ¶
func (r *ResourceOracle) DMI() (*dmi.DMI, error)
DMI run and parse dmidecode commands
func (*ResourceOracle) Disks ¶
func (r *ResourceOracle) Disks() (d Disks, err error)
Disks list and parse the hardware information using smartctl
func (*ResourceOracle) GPUs ¶
func (r *ResourceOracle) GPUs() ([]PCI, error)
GPUs returns the list of available GPUs as PCI devices
func (*ResourceOracle) GetHypervisor ¶
func (r *ResourceOracle) GetHypervisor() (string, error)
GetHypervisor gets the name of the hypervisor used on the node
func (*ResourceOracle) Total ¶
func (r *ResourceOracle) Total() (c gridtypes.Capacity, err error)
Total returns the total amount of resource units of the node
func (*ResourceOracle) Uptime ¶
func (r *ResourceOracle) Uptime() (uint64, error)
Uptime returns the uptime of the node
type Subdevice ¶
type Subdevice struct { // SubsystemVendorID is device subsystem vendor ID according to PCI database SubsystemVendorID uint16 // SubsystemVendorID is device subsystem ID according to PCI database SubsystemDeviceID uint16 // Name is subdevice name according to PCI database Name string }
Subdevice is subdevice information to a PCI device