Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

adding pci passwhtrough to node pools #4513

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tkg/client/machine_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,39 @@ type VSphereNodePool struct {
MemoryMiB int64 `yaml:"memoryMiB,omitempty"`
DiskGiB int32 `yaml:"diskGiB,omitempty"`
NumCPUs int32 `yaml:"numCPUs,omitempty"`

// PCI and GPU related parameters...
HardwareVersion string `yaml:"hardwareVersion,omitempty"`
PCISettings *VsphereNodePoolPCI `yaml:pciSettings,omitempty`
PCIDevices []*VsphereNodePoolPCIDevice `yaml:pciDevices,omitempty`
}

/*
*

/spec/template/spec/pciDevices
- deviceId: 0x10DE <-- this defines "nvidia"
vendorId: 0x1EB8 <-- this identifies that it is a "T4 GPU"
- deviceId: ...
vendorId: ...
*/
type VsphereNodePoolPCIDevice struct {
DeviceId string `yaml:"deviceId,omitempty"`
VendorId string `yaml:"vendorId,omitempty"`
}

/*
/spec/template/spec/customVMXKeys:
- pciPassthru.allowP2P:true
pciPassthru.RelaxACSforP2P:true
pciPassthru.use64bitMMIO:true
pciPassthru.64bitMMIOSizeGB:512
*/
type VsphereNodePoolPCI struct {
Use64bitMMIO bool `yaml:"use64bitMMIO,omitempty"`
N_64bitMMIOSizeGB int `yaml:"64bitMMIOSizeGB,omitempty"`
AllowP2P bool `yaml:"allowP2P,omitempty"`
RelaxACSforP2P bool `yaml:"relaxACSforP2P,omitempty"`
}

const deploymentNameLabelKey = "cluster.x-k8s.io/deployment-name"
Expand Down